Search code examples
c#.netwindowswindows-phone-8.1textblock

Display &#8211 text with Smileys in windows phone 8.1 C# (smileys are look like &#8211.)


I have a string from server that contains content string with html tags and smileys are there.

I'm able to get rid of HTML tags with this,

string get_title_with_noHTML = Regex.Replace(get_title, @"<[^>]+>| ", "").Trim();

But the smileys are as it is. Not able to get solution for smileys while surfing much.

Here is the windows phone screen Shot: enter image description here

The smileys look like the red square area. I have tried this with RichTextblock but richtextblock hasn't the text property.

I tried with this RichTextBlock Example.

       var control = sender as RichTextBlock;
      if (control != null)
      {
      control.Blocks.Clear();
      string value = e.NewValue.ToString();

      var paragraph = new Paragraph();
      paragraph.Inlines.Add(new Run {Text = value});
      control.Blocks.Add(paragraph);
 }

but the result isn't the exact.

How can I get the exact smileys? what would be the possible solution? Thanks in advance!


Solution

  • I got solution for this.

     string header_dashboard = Windows.Data.Html.HtmlUtilities.ConvertToText(YouStringswith_&#8221);