百度搜索中关键字的编码方法和解码方法http://community.csdn.net/Expert/TopicView3.asp?id=5744800

百度的编码:
str = System.Web.HttpUtility.UrlEncode("中文", System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper()

解码
System.Web.HttpUtility.UrlDecode("%C3%CF%CF%DC%BB%E1", System.Text.UnicodeEncoding.GetEncoding("GB2312"))



string a = System.Web.HttpUtility.UrlEncode("孟宪会", System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper();
Response.Write(a);
Response.Write(System.Web.HttpUtility.UrlDecode("%C3%CF%CF%DC%BB%E1", System.Text.UnicodeEncoding.GetEncoding("GB2312")));
 

你可能感兴趣的:(百度搜索中关键字的编码方法和解码方法http://community.csdn.net/Expert/TopicView3.asp?id=5744800)