私の Windows Phone アプリケーションでは、インターネットから RSS を取得し、XML を解析します。rss から Title と Description を取り出し、TextBlock に表示します。
ここで、特殊文字がひし形に置き換えられ、「?」が含まれているという問題がいくつか見つかりました。
/*CONNECTION AND DOWNLOAD RSS*/ WebClient wc = new WebClient(); wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(load_web_news); wc.DownloadStringAsync(new Uri("http://.../rssFeedNews.asp")); .... /*SAVE RSS*/ TextBlock tbTitle = new TextBlock(); Run rTitle = new Run(); rTitle.Text = rss.Title; Run rDescription = new Run(); rDescription.Text = rss.Description; tbTitle.Inlines.Add(rTitle); .... /*PARSING*/ private void load_web_news(object sender, DownloadStringCompletedEventArgs e) { XElement xmlitems = XElement.Parse(e.Result); List<XElement> elements = xmlitems.Descendants("item").ToList(); foreach (XElement rssItem in elements) { RSSItem rss = new RSSItem(); rss.Description1 = rssItem.Element("description").Value; String title = rssItem.Element("title").Value;
Windows電話アプリで「à」「è」「°」などの特殊文字を表示するにはどうすればよいですか?