日期:2014-05-18  浏览次数:20764 次

如何将“%D6%D0%B9%FA”这样的字符转换为正常的字符串?
如何将“%D6%D0%B9%FA”这样的字符转换为正常的字符串?

------解决方案--------------------
比如:
Response.write(Server.UrlEncode( "美女 "))
输出:
%c3%c0%c5%
------------------
string aa = "%D6%D0%B9%FA ";
string x = System.Web.HttpUtility.UrlDecode(aa,System.Text.Encoding.GetEncoding( "Gb2312 "));
Response.Write(x);

string y = System.Web.HttpUtility.UrlEncode(x,System.Text.Encoding.GetEncoding( "Gb2312 "));
Response.Write(y);


bb=Server.UrlEncode(aa);
aa=Server.UrlDecode(bb);