我正在尝试从这里的链接获取XML内容。然后获取要在屏幕上显示的"item“元素的内容。这是WP7上的RSS阅读器。问题是当我检查内容时,字节似乎已经被修改(翻译)了不同的编码方式,这应该是使用BIG5,但它没有。但是,本机浏览器确实会显示这些BIG5编码的字符。不知道他们是怎么得到的。
我试过了
using (XmlReader reader = XmlReader.Create(URL) //URL to a XML file on Internet
while (reader.Read()) // iterate through the document
switch (reader.NodeType)
case XmlNodeType.Text:
string s = reader.Value; // The string displayed as garbage我试着按照Jesse的建议使用EncodingGenerator,但这不起作用,因为它不支持多字节编码。
发布于 2012-04-27 03:26:24
我认为不支持BIG5编码通常是Windows Phone的问题,而不是XmlReader的问题。所以如果你切换到HtmlAgilityPack,你也会遇到同样的问题。
请查看https://stackoverflow.com/a/10277767/736079以获取可能的解决方案。
https://stackoverflow.com/questions/10307223
复制相似问题