Defect #10593
closed
Error: 'incompatible character encodings: UTF-8 and ASCII-8BIT' (old annoing issue) on ruby-1.9.3
Added by Alexander Oryol over 12 years ago.
Updated almost 12 years ago.
Description
My instance Redmine was gradually upgraded from 0.7 and older.
When I upgrade to ruby-1.9.3, some projects issues list crashes with 'incompatible character encodings: UTF-8 and ASCII-8BIT'.
The trouble be found in CustomField: Browser (type: list)
In DB possible_values was serialized as:
- !binary |
0J3QtSDQvtC/0YDQtdC00LXQu9C10L0=
and deserialized into string with #<Encoding:ASCII-8BIT>.
Solution:
$> script/console production
c = CustomField.find(5)
c.possible_values.each {|i| i.force_encoding('UTF-8')}
c.save
Now, value serialized as:
- "\xD0\x9D\xD0\xB5 \xD0\xBE\xD0\xBF\xD1\x80\xD0\xB5\xD0\xB4\xD0\xB5\xD0\xBB\xD0\xB5\xD0\xBD"
and work fine!
- Status changed from Resolved to New
- Target version set to 1.4.0
- Affected version (unused) set to devel
Potential release blocker.
This error happen on ruby-1.8.7 too, when I try to edit affected custom field. CustomFieldsController#edit
Which version (Redmine|Ruby) serialize UTF-8 to YAML as binary?
My instance lived initially on ruby-1.8.6
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
I was able to reproduce and fixed it in r9330.
Hello,
ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
15: </tr></thead>
16: <% enumerations.each do |enumeration| >
17: <tr class="<= cycle('odd', 'even') >">
18: <td><= link_to h(enumeration), edit_enumeration_path(enumeration) ></td>
19: <td class="center" style="width:15;"><%= checked_image enumeration.is_default? ></td>
20: <td class="center" style="width:15;"><%= checked_image enumeration.active? ></td>
21: <td style="width:15;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}, :put) %></td>
app/views/enumerations/index.html.erb:18:in `block (2 levels) in app_views_enumerations_index_html_erb_76608041_28216668'
app/views/enumerations/index.html.erb:16:in `block in app_views_enumerations_index_html_erb_76608041_28216668'
app/views/enumerations/index.html.erb:3:in `each'
app/views/enumerations/index.html.erb:3:in `_app_views_enumerations_index_html_erb__76608041_28216668'
app/controllers/enumerations_controller.rb:30:in `index'
I'm using Português(Brasil)
This error occurrs only using Português(Brasil) when I using English this not occurrs.
I'm using adpater mysql2.
Also available in: Atom
PDF