I\'m exporting data to a CSV file in rails and in some of my fields, I\'m getting character encoding issues like this when I open in Excel:
didn’t
<
This is my approach using I18n.transliterate:
def self.to_csv(options = {})
csv = CSV.generate(options) do |csv|
csv << your_attributes
end
I18n.transliterate(csv)
end
I18n.transliterate just removes strange characters, and tries to make them readable (for example it will replace á with a, ö with o, etc). Just give it a try.