Decoding all HTML Entities

Then maybe you will need the HttpUtility.HtmlDecode?. It should work, you just need to add a reference to System.Web. At least this was the way in .Net Framework < 4.

For example the following code:

MessageBox.Show(HttpUtility.HtmlDecode("&amp;&copy;"));

Worked and the output was as expected (ampersand and copyright symbol). Are you sure the problem is within HtmlDecode and not something else?

UPDATE: Another class capable of doing the job, WebUtility (again HtmlDecode method) came in the newer versions of .Net. However, there seem to be some problems with it. See the HttpUtility vs. WebUtility question.


Use WebUtility.HtmlDecode included in .Net 4

For example, if I run in a console app:

  Console.WriteLine(WebUtility.HtmlDecode("&nbsp;, &amp;, &copy;"));

I get , &, c