Windows phone 8 加载rss源时Windows phone崩溃
我有一些代码可以将rss源加载到我的WindowsPhone应用程序:Windows phone 8 加载rss源时Windows phone崩溃,windows-phone-8,rss,windows-phone,linq-to-xml,Windows Phone 8,Rss,Windows Phone,Linq To Xml,我有一些代码可以将rss源加载到我的WindowsPhone应用程序: var result = e.Result; result = result.Replace("\t", string.Empty); result = result.Replace("\n", string.Empty); var rssItems = XDocument.Parse(result.Replace("dc:creator", "creator")).Descendants("ite
var result = e.Result;
result = result.Replace("\t", string.Empty);
result = result.Replace("\n", string.Empty);
var rssItems = XDocument.Parse(result.Replace("dc:creator", "creator")).Descendants("item").Select(
x => new RssItem()
{
Title = (string)x.Element("title"),
Description = (string)x.Element("description"),
Link = (string)x.Element("link"),
Author = (string)x.Element("creator"),
Comments = (string)x.Element("comments"),
PubDate = ParseNewsDateToStringFormatExtended(Convert.ToDateTime((string)x.Element("pubDate"))),
ThumbnailPart = stripImagePathFromDescription((string)x.Element("description").Value.ToString()),
StrippedHtml = strippedHtmlConversion((string)x.Element("title"), (string)x.Element("creator"), ParseNewsDateToStringFormatExtended(Convert.ToDateTime((string)x.Element("pubDate"))), (string)x.Element("description").Value.ToString())
}
).ToList();
success(rssItems);
当加载包含此符号«或»的提要时,它崩溃。如何使我的应用程序能够读取这些符号
编辑:以下是我的rss提要中的一个元素:
<item>
<title>Norges «skjulte perle» utvider</title>
挪威«斯克朱尔特佩尔»乌特维德
如您所见,项目标题中有一个«»。我知道这就是它崩溃的原因。但是为什么呢?以及如何处理这些符号?请提供它崩溃的数据示例。请参阅更新的答案。我无法链接整个项目,因为它自动转换了许多符号,所以它实际上无法读取。您是否尝试过
result=result.Replace(“«”,string.Empty)代码>和result=result.Replace(“»”,string.Empty)代码>?