WebHeaderCollection webHeader = resPonse.Headers;string str = webHeader.Get("Content-Disposition");
Content-Disposition有中文的时候,str则有乱码。
如果使用下面方法则不会乱码byte[] bytes_AllHeader = webHeader.ToByteArray();
string str2 = Encoding.GetEncoding("GBK").GetString(bytes_AllHeader);
使用GB2312、GBK编码都没有问题,可是我又改变不了webHeader.Get的编码方法。使用resPonse.GetResponseHeader("Content-Disposition");同样是乱码。我怎么样才能把乱码显示为正常的汉字?