I have the following C# code that writes Umlaute characters to a csv file. Upon opening the file these characters are completely distorted. Here is the code:
string csvFile = string.Empty;
using (System.IO.StreamWriter file = new System.IO.StreamWriter(fileName))
{
//DataTable columns are already formatted WRT commas and double quotes
for (int i = 0; i < dt.Rows.Count; i++)
csvFile += String.Join(",", dt.Rows[i].ItemArray) + "\r\n";
file.WriteLine(csvFile);
}
I checked the string 'csvFile' and it does hold these characters correctly. Is this excel issue or within my code?