解码
解中文乱码
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);