Hi All,
I've been trying to figure this out, but no luck.
I have an xml file with UTF-8 encoding.
I am parsing it so my C# strings are showing the unicode (UTF-16) representation for the UTF-8 encoding.
i.e. ' instead of '
Now, I am trying this:
Now, I am getting chinese stuff like this.
If I put ASCII instead of Unicode when asking for the string I get the same mess I started from.
anyone can help?
Thanks in advance,
JI
I've been trying to figure this out, but no luck.
I have an xml file with UTF-8 encoding.
I am parsing it so my C# strings are showing the unicode (UTF-16) representation for the UTF-8 encoding.
i.e. ' instead of '
Now, I am trying this:
Code:
byte[] bytes; byte[] uniBytes; bytes = Encoding.UTF8.GetBytes(myString); uniBytes = Encoding.Convert(Encoding.UTF8, Encoding.Unicode, bytes); myString = System.Text.Encoding.Unicode.GetString(uniBytes);
If I put ASCII instead of Unicode when asking for the string I get the same mess I started from.
anyone can help?
Thanks in advance,
JI
Comment