I'm generating a CSV like this
::CSV.generate(headers: true) do |csv|
csv << ['Date', 'Transaction', 'Order Total', 'Wallet Amount', 'Wallet Balance']
fetch_data.each do |data_response|
data_response.wallet_amount = "₹40"
csv_data = { date: data_response.display_date}
.merge(data_response.to_h.except(*skip_attributes))
csv << csv_data.values
end
end
Now after generating it when I open it in Linux it works fine but not for Ms-Excel. Currency symbols like ₹, € not showing properly.
Here is the sample picture from Ms-Excel
and when i tried to convert it in iso format like this
::CSV.generate(headers: true, encoding: 'ISO-8859-9')
the error i got is
Encoding::UndefinedConversionError (U+20B9 from UTF-8 to ISO-8859-9)
is there any way that my euro and INR symbols can show on Ms-excel
'₹ €'.encode( 'utf-8').decode('cp1254')
returns'₹ €'
. – Organic.csv
file. DetermineUTF-8
. – Organic