ISO-8859-1 doesn't support degree symbol

  • Thread starter Thread starter gankuganesh
  • Start date Start date
G

gankuganesh

Guest
Hi Team,

I have used below code to de-serialize an xml text,

using (var ms = new MemoryStream(Encoding.GetEncoding("ISO-8859-1").GetBytes(xmlText)))
{
var s = new XmlSerializer(typeof(MyObject));
dtsMessages = (MyObject)s.Deserialize(new StreamReader(ms));
}


There is a degree symbol in the text but the symbol is getting converted to question-mark (?) and seems doesn't support it.

But when I tried UTF-8 encoding degree symbol is getting encoded. What is the issue with ISO-8859-1? since the degree symbol is coming under ISO-8859-1 standard.

Please help me out.

Thanks,

ganku

Continue reading...
 
Back
Top