public static string ConvertExtendedASCII(string HTML) { StringBuilder str = new StringBuilder(); char c; for (int i = 0; i < HTML.Length; i++) { c = HTML[i]; if (Convert.ToInt32(c) > 127) { str.Append("&#" + Convert.ToInt32(c) + ";"); } else { str.Append(c); } } return str.ToString(); }
找了很多方法,有编码解码的替换“%2B”“+”都没有效果。这个方法我试了好用。原文:http://www.wtnzone.com/post/2011/09/05/WP7-WebBrowser-NavigateToString-International-UTF-8.aspx
时间: 2024-10-25 04:52:50