In my Windows Phone application, I take RSS from Internet and I parse XML. I take out Title and Description from rss, and display them in a TextBlock.
Here I find some problems, the speacial characters are substituted by rhombus contain "?".
/*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;
How to display special chars for example "à" "è" "°" etc... in a WIndows phone app?