开发者

Convert "& aring;" "& ouml;" to its normal representation

开发者 https://www.devze.com 2023-03-24 19:05 出处:网络
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.

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 pr开发者_Go百科operty, I'm getting some special letter encoded as å and ö .

How to convert them to normal representation?


Use the HttpUtility.HtmlDecode method

HttpUtility.HtmlDecode("å"); // å


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号