Using Ruby 1.8.7, I want to accept csv into my system, although this is an admin application, it looks like I can get several different types of csvs. On my mac, if I export from excel using the "windows csv" option, then fastcsv can read it by default. On windows, I seem to get utf-16 encoded csvs (which I still don't understand how to understand)
It seems like a fairly common occurrence allowing users to download csv, which can be in utf8, utf16, ascii, etc. formats, to detect and analyze them. Has anyone figured this out?
I started looking for a UniversalDetector to help me identify and then use Iconv to convert, but it seems complicated and was hoping someone would figure it out :)
source
share