Im using Active Admin with Rails and I'm exporting all my data in a csv file. It works really well in development, but in production i get this error :
Encoding::UndefinedConversionError (U+00E7 to WINDOWS-1251 in conversion from UTF-8 to WINDOWS-1251)
When I send_data :
date = DateTime.now
csv_title = "O535#{date.year}#{date.strftime('%m')}#{date.strftime('%d')}#{date.strftime('%H')}#{date.strftime('%M')}#{date.strftime('%S')}"
send_data csv.force_encoding('UTF-8'),
:type => 'text/csv; charset=iso-8859-1; header=present',
:disposition => "attachment; filename=#{csv_title}.csv"
Has anyone ever met that error ? I tried using csv.encore / csv.force_encoding and many other solutions but it's still working well in development but always crash in production
Thanks a lot