2012-09-15 141 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;");