当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - iso-8859-1 string to Unicode string

问题描述:

i get html source of page with this line of code

WebClient client = new WebClient();

string sPage = client.DownloadString(url);

page code package is iso-8859-1

but exist unicode string like below in html source

<span title="&#1590;&#1575;&#1601;&#1607;"

how can i convert this code to Unicode string in c# ?

网友答案:
 string s = HttpUtility.HtmlDecode(@"<span title=""&#1590;&#1575;&#1601;&#1607;");
分享给朋友:
您可能感兴趣的文章:
随机阅读: