2012-09-15 142 views
0

我得到网页的HTML源代码这一行代码ISO-8859-1字符串Unicode字符串

WebClient client = new WebClient(); 
string sPage = client.DownloadString(url); 

页面代码包是ISO-8859-1

但存在unicode字符串象下面这样html源代码

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

如何将此代码转换为Unicode字符串在C#中?

回答

1
string s = HttpUtility.HtmlDecode(@"<span title=""&#1590;&#1575;&#1601;&#1607;");