解码

解中文乱码

string str1 = "ÖлªÈËÃñ¹²ºÍ¹ú";

//文字自己的编码
Encoding ecSelf = Encoding.GetEncoding("Unicode");
byte[] btArr = ecSelf.GetBytes(name);

//需要转成了编码
Encoding ecLastCode = Encoding.GetEncoding("gb2312");
string lastCode = ecLastCode.GetString(btArr);

解cookie乱码

HttpUtility.UrlDecode(name);

 

posted @ 2015-09-02 10:07  注定likeyou  阅读(306)  评论(1编辑  收藏  举报