I have this CSV upload feature on this rails site I''m working on. The
CSV file contains all kinds of French, and Italian words that are
uploaded into the DB. The problem I''m having is after the words are
uploaded, some of the characters are changes to either the little
diamond question mark thing, or the box with the 4 small digits in it,
or just another letter altogether.
The CSV is iso-8859-1. I''ve changed the database.yml to encoding:
latin1, tried running ''alter table words charset=latin1;'' in
mysql. I''ve
tried using string.force_encoding(Encoding::ISO_8859_1) when saving, and
even wrote a method in the String class
class String
def to_iso
Iconv.conv(''ISO-8859-1'', ''utf-8'', self)
end
end
I even have the <meta http-equiv="Content-Type"
content="text/html;
charset=iso-8859-1" /> in my layout....
So, what are the best steps to take a .CSV file that is full of
ISO-8859-1 characters, and upload it to the DB so they are displayed
exactly how they are in the file?
Bonus Question:
In case anyone knows.... The CSV file is being created with Microsoft
Excel. Is there a way to save the file as UTF-8 so I can just move on
with my life? :)
Thanks for the help,
~Jeremy
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.