ISO-8859-1不支持度数符号 [英] ISO-8859-1 doesn't support degree symbol

查看:74
本文介绍了ISO-8859-1不支持度数符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,

我使用下面的代码反序列化xml文本,

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.

但是当我尝试使用UTF-8编码时,符号符号被编码。    ISO-8859-1有什么问题? 因为学位符号符合ISO-8859-1标准。

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.

请帮帮我。

谢谢,

ganku

推荐答案

嗯,确定输入编码?原因XML很少用不同的字符集编码,然后用Unicode编码。
hmm, sure about the input encoding? Cause XML is rarely encoded in a different charset then the Unicode ones..


这篇关于ISO-8859-1不支持度数符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆