problem with encoding
In tag tab, i will receive this message:
incompatible character encodings: ASCII-8BIT and UTF-8
Rendered projects/tags/index.html.haml within layouts/projects (9.3ms)
Encoding::CompatibilityError (incompatible character encodings: ASCII-8BIT and UTF-8):
app/views/projects/tags/index.html.haml:22:in `block in _app_views_projects_tags_index_html_haml___3649783557607948966_50827820
'
app/views/projects/tags/index.html.haml:15:in `each'
app/views/projects/tags/index.html.haml:15:in `_app_views_projects_tags_index_html_haml___3649783557607948966_50827820'
app/controllers/application_controller.rb:57:in `set_current_user_for_thread'
to fix, use this:
diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml
index c88e42a..2cdc419 100644
--- a/app/views/projects/tags/index.html.haml
+++ b/app/views/projects/tags/index.html.haml
@@ -1,3 +1,4 @@
+# encoding: utf-8
= render "projects/commits/head"
- if can? current_user, :push_code, @project
@@ -18,9 +19,9 @@
%h4
= link_to project_commits_path(@project, tag.name), class: "" do
%i.icon-tag
- = tag.name
+ = tag.name.to_s.force_encoding("UTF-8")
%small
- = truncate(tag.message || '', length: 70)
+ = truncate(tag.message.to_s.force_encoding("UTF-8") || '', length: 70)
.pull-right
%small.cdark
%i.icon-calendar