UTF-8 encoding problem (Specific to CVS)

Hi all,

I'm writing characters to output file (am using UTF - 8 encoding). When I write to the text file, the output is fine. But when I write it as CVS the output got scrambled.

Sample

Fran鏰is - Textpad

Fran莽ais - CVS (Scrambled)

I'm using the following stream encoder

StreamEncoder.forOutputStreamWriter(out, this, charsetName);

Note: My CVS open tool, MS-Excel have language support enabled. Also i'm not overriding the arial font.

Hope, some one would have already mastered it.

Thanks,

Sen

[564 byte] By [sennata] at [2007-10-1 21:41:02]
# 1
I think its CSV (comma seperated variable) and not CVS. Hope u made a typo error in that.
Rajeshram7a at 2007-7-13 3:35:26 > top of Java-index,Desktop,I18N...
# 2

This seems to be purely a display issue - Excel seems to display the UTF-8 characters in Windows 1252 (or ISO-8859-1) code page. You need to figure out how to get Excel to understand that the file is in UTF-8. Could be a question of a missing BOM - I know that Notepad writes a BOM in UTF-8 files when it saves them, Excel might expect it.

one_danea at 2007-7-13 3:35:26 > top of Java-index,Desktop,I18N...
# 3

CSV not CVS :)

It's a problem in Excel (you open your file in Excel, right?) which doesn't care about encoding.

However, there's a workaround but not so pleasant:

use the .txt extension instead of .csv

When you open such file from within Excel, you would pass through an import wizard which normally asks you the encoding of such file. CSV file don't pass through such wizard.

HTH

horiniusa at 2007-7-13 3:35:26 > top of Java-index,Desktop,I18N...