Unicode in WIndows and Linux
Hi
I am working on a Java web application on Linux and it is in Japanese. I have an "export to CSV file" function and use OutputStreamWriter with utf-8 encoding. Everything is fine except when I view this file in Windows Excel.. the file produces the wrong characters.
Alternatively, when I try to set the encoding to shift-jis, the file works on Windows but Linux outputs garbage characters.
Is there any way to make the CSV file work for both machine? Any help would be greatly appreciated. Thank you!
# 2
With CSV files you need to use the "Import Data" function in Windows Excel to be able to specify that the data is in UTF-8, and you also need to have Excel 2003, previous versions don't have UTF-8 in the list of supported code pages.
# 3
Thanks one_dane. I actually did some research and found out that Excel is indeed troublesome when it comest to CSV files with encoding.
The CSV file actually works on Excel if I try to save it again in ANSI encoding. So now Excel works on ANSI and Shift-JIS and Linux only recognizes Japanese when exported in UTF-8.
I don't know if there's still a work around for this or I really have to let the client do the manual encoding of the CSV files.
Microsoft is so much trouble lol.