本帖最后由 cload 于 2014-11-9 00:25 编辑
[C#] 纯文本查看 复制代码 public static string DecodeStr(string Source)
{
string tem = Source;
if (Source.Contains("&#"))
{
tem = "";
if (Source.EndsWith(";")) Source = Source.Substring(0, Source.Length - 1);
string[] tmp = Regex.Replace(Source, "&#", "").Split(';');
for (int i = 0; i < tmp.Length; i++)
{
string t = int.Parse(tmp[i]).ToString("x4");
tem += "%u" + t.Substring(t.Length - 4);
}
}
return HttpUtility.UrlDecode(tem);
}
string s = DecodeStr("中国人民");//发上来被自动转码了,参数就是你截图中的"&#****"数据 |