I want to make a simple csv-file, and open it in Excel.
What I do is:
Problem:
when I set encoding ENC to Unicode, Excell puts all values in one column. So, my guess is Excell cant't interpret unicode correctly, and I tried other encoding.
Using either UTF8 OR ASCI, Excel puts everything in the right column. However, diacrytical characters like 'è' or 'ë' are replaced with other characters - they were displayed OK using Unicode.
So I've been messing with setting the file-encoding to ASCI, and then trying to convert the values from unicode to asci before writing to file, but nope...
Has anybody solved this problem?
What I do is:
Code:
string URL = strPath + strFile + ".csv";
FileStream FS = File.Open(URL, FileMode.Create);
Encoding ENC;
ENC = new UnicodeEncoding();
StreamWriter SW = new StreamWriter(FS,ENC);
...
SW.WriteLine ("value1,value2")
when I set encoding ENC to Unicode, Excell puts all values in one column. So, my guess is Excell cant't interpret unicode correctly, and I tried other encoding.
Using either UTF8 OR ASCI, Excel puts everything in the right column. However, diacrytical characters like 'è' or 'ë' are replaced with other characters - they were displayed OK using Unicode.
So I've been messing with setting the file-encoding to ASCI, and then trying to convert the values from unicode to asci before writing to file, but nope...
Has anybody solved this problem?