C#, reading a text file with å ä ö, saving data as XML. The å ä ö becomes corrupt. How solve?
Using C#, I am reading a tab separated text file, generated from an MS Excel original.
I then read an XML-template file, and I add the text-file data as new children in the XML, and then save the XML.
All works fine, except that "special characters" (mostly Swedish characters å, ä and ö) that show just nicely in both the Excel original and the tab-separated text file, get corrupted in the XML (they turn into little "squares"). I am not new to programming, but I am totally new to most Microsoft products and C# in general. And character encoding problems are my biggest issue. I can never remember how to solve these problems.
I have googled the problem, have tried all suggested solutions, including making sure that the original XML-template file is saved as ISO-8859-1 etc, but all to no avail. Any help is appreciated.
Open Dec 09, 2009 - 01:08 AM
excel, Text, Microsoft, XML, programming, encoding