public string QueryStringDecode(string key)
{
if (Regex.IsMatch(
HttpUtility.UrlDecode(Request.Url.Query, Encoding.GetEncoding("iso-8859-1")),
@"^(?:[/x00-/x7f]|[/xfc-/xff][/x80-/xbf]{5}|[/xf8-/xfb][/x80-/xbf]{4}|[/xf0-/xf7][/x80-/xbf]{3}|[/xe0-/xef][/x80-/xbf]{2}|[/xc0-/xdf][/x80-/xbf])+$"
))
{
return Request.QueryString[key];
}
else
{
System.Collections.Specialized.NameValueCollection Rq = HttpUtility.ParseQueryString(Request.Url.Query, System.Text.Encoding.GetEncoding("gb2312"));
return Rq[key];
}
}
UTF-8 || gb2312
最新推荐文章于 2021-05-19 20:28:32 发布