10 April 2006

UTF8 CSV files.

We're getting lists to be imported into MySQL in Excel (.xls) formats.
When we use MS Office to export it into CSV,
reading the data gives us gibberish, because
the default encoding is plain old ASCII.

There is not obvious setting available to change the ASCII to UTF8
for the csv file in Microsoft Office.

So I tried Open Office to see if it offers anything better.
In Save As, Change the Type to CSV, then the 'Edit Filter Settings'
checkbox will be enabled. Check this, and when you click save,
a dialog will appear requesting which Character Set to use.

And sure enough, it works like a charm.
The CSV loads up and saves into MySQL OK.

Hooray Open Office. Works better for multilingual requirements.

BTW, if anyone has the solution to export as UTF8 CSV from
MSOffice, please post it here.

yk