REDMINE - incompatible character encodings: ASCII-8BIT and UTF-8

June 29, 2014 7.3k views

I'm having a trouble seeing pages that uses Spanish Charset (i.e accents, ñ, etc).

The log to one page (issues), for example tells my:

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT): 
60: <% if @issues.empty? %> 
61: <p class="nodata"><%= l(:label_no_data) %></p> 
62: <% else %> 
63: <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> 
64: <p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p> 
65: <% end %> 
66: 
app/views/issues/index.html.erb:63:in `_app_views_issues_index_html_erb___1752021154048040311_51435780' 
app/controllers/issues_controller.rb:87:in `block (2 levels) in index' 
app/controllers/issues_controller.rb:86:in `index'

Seeing the solutions in many redmine wikis / blogs is to run gem install mysql2 (i did it) and then change the database.yml adapter to mysql2 (i also did it).

But everything it's the same.

Could yoy help me with this problem?

9 Answers

How did you install Redmine? Are you using the one-click Redmine application image?

yes.. I installed one-click Redmine application image on my droplet (107.170.165.73)

Hi Kamal, I update the file my.conf just like the post said but everything it's the same :(

Now my new redmine.log said:

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    60: <% if @issues.empty? %>
    61: <p class="nodata"><%= l(:label_no_data) %></p>
    62: <% else %>
    63: <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
    64: <p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p>
    65: <% end %>
    66: 
  app/views/issues/index.html.erb:63:in `_app_views_issues_index_html_erb___590543777811004549_61670660'
  app/controllers/issues_controller.rb:87:in `block (2 levels) in index'
  app/controllers/issues_controller.rb:86:in `index'

The wired thing is that in page 107.170.165.73/project_name/activity the compress view of our issues shows perfect, but when we were access to one specific issue the error above always shows.

This is a requirement thing to start a new quality process of our startup, so we are really need this response.

Many thanks

Sorry i learn something new (the code button at this editor), so i pasted the output better now:

mysql> show variables like '%character%';                                                                                                                          
+--------------------------+----------------------------+                                                                                                          
| Variable_name            | Value                      |                                                                                                          
+--------------------------+----------------------------+                                                                                                          
| character_set_client     | utf8                       |                                                                                                          
| character_set_connection | utf8                       |                                                                                                          
| character_set_database   | utf8                       |                                                                                                          
| character_set_filesystem | binary                     |                                                                                                          
| character_set_results    | utf8                       |                                                                                                          
| character_set_server     | utf8                       |                                                                                                          
| character_set_system     | utf8                       |                                                                                                          
| character_sets_dir       | /usr/share/mysql/charsets/ |                                                                                                          
+--------------------------+----------------------------+                                                                                                          
8 rows in set (0.00 sec)                                                                                                                                           

mysql> show variables like '%collation%';                                                                                                                          
+----------------------+-----------------+                                                                                                                         
| Variable_name        | Value           |                                                                                                                         
+----------------------+-----------------+                                                                                                                         
| collation_connection | utf8_general_ci |                                                                                                                         
| collation_database   | utf8_general_ci |                                                                                                                         
| collation_server     | utf8_unicode_ci |                                                                                                                         
+----------------------+-----------------+                                                                                                                         
3 rows in set (0.00 sec)                                           

Kamal, i just enter into http://5.101.103.136/ and get the same error that we have:

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

Back

mmmm... i think that some "timezone" and "regional configuration" issue it's affecting.

If we use a proxy to see your droplet, we see it perfectly (Proxies List)

Could you try in your project to create an issue with this subject: "Probando configuración" and with description: "testeando otra configuración"?

And then try to access to the issue list and de detail view of this issue.

If you see everything correctly so it´'s some regional configuration that isn't work fine to us.

But if not it's a redmine config that we can't understand ;)

May I ask you an additional check?

Could you create an issue with the subject and description that i gave you?

Because we had this bug when we create an issue with spanish characters.

Many thanks

I have done it :)

I install the last version of mysql2 (0.3.16), then i change de GEMFILE to set this version, then i did a bundle update.

And that's it :)

  • Glad to hear it's working now! I'll update the image to use mysql2 instead of mysql.

You can move tmp to tmp_old and create tmp -> change owner to website owner in redmine and restart redmine (httpd if you run passenger).

Have another answer? Share your knowledge.