Return "& aring;" "& ouml;" to their original form.

c# character-encoding html-agility-pack iso-8859-1

Question

I'm loading a web page System.Net.WebClient. Page is in ISO-8859-1 encoding. If I write it to file and then open, I can see all characters normally.

But if I put this content into HtmlAgilityPack and then extract innerText property, I'm getting some special letter encoded as å and ö .

How to convert them to normal representation?

1
1
2/24/2012 9:07:12 AM

Accepted Answer

Use the HttpUtility.HtmlDecode method

HttpUtility.HtmlDecode("å"); // Ã¥
5
7/31/2011 8:34:38 PM

Popular Answer

You can call the HtmlEntity.DeEntitize method with the text string as the parameter.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow