krhorst / active_admin_importable

CSV imports for Active Admin resources
MIT License
53 stars 55 forks source link

Encofing problems #20

Open AlexVPopov opened 11 years ago

AlexVPopov commented 11 years ago

When I try to import a UTF-8 encoded CSV file containing Cyrillic characters, I get this error: Encoding::UndefinedConversionError in Admin::ShareholdersController#import_csv

"\xD0" from ASCII-8BIT to UTF-8

besi commented 8 years ago

I ran into something similar:

From the console:

>> hash[:name]
=> "Gr\xC3\xBCnes St\xC3\xBChlchen"
>> hash[:name].force_encoding('UTF-8')
=> "Grünes Stühlchen"

So I will now iterate through my hash and force-encode all values like described above.