Project

General

Profile

Actions

Defect #10593

closed

Error: 'incompatible character encodings: UTF-8 and ASCII-8BIT' (old annoing issue) on ruby-1.9.3

Added by Alexander Oryol about 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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!


Related issues

Related to Redmine - Feature #4050: Ruby 1.9 supportClosed2009-10-18

Actions
Actions

Also available in: Atom PDF