1

Hello, I would like to decode html entities but I have an issues when the entities numbers is greater than 127.

I am using WebUtility.HtmlDecode

Example :

class Program
{

    static void Main(string[] args)
    {
        string text = "`°•»ZEЯO«•°´";
        Console.WriteLine(WebUtility.HtmlDecode(text));
        Console.ReadKey();
    }
} 

Output : `°»ZE?O«°´ and not : `°•»ZEЯO«•°´

The problems is that entities is not decoded correctly.

Я

I would like to know how can I decode it, I did a lot of search and I was not able to find a solution...

Thanks in advance for your help.

Serguei Fedorov
  • 7,763
  • 9
  • 63
  • 94
Linkpad
  • 39
  • 1
  • 6

1 Answers1

4

The problem is not with WebUtility.HtmlDecode - if you step through you'll see the representation is fine in Visual Studio. The problem is that the Console can't, by default, display Unicode.

Tim Ebenezer
  • 2,714
  • 17
  • 23