C# HttpWebResponse CharacterSet ISO-8859-1 中文乱码解决方法

    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream responseStream;
            if (response.ContentEncoding == "gzip")
            { 
                responseStream = new GZipStream(response.GetResponseStream(), CompressionMode.Decompress);
            }else {
                responseStream = response.GetResponseStream();
            } 
            StreamReader reader = new StreamReader(responseStream, Encoding.GetEncoding("gb2312"));

            string srcString = reader.ReadToEnd();


  折磨了我很久

你可能感兴趣的:(C# HttpWebResponse CharacterSet ISO-8859-1 中文乱码解决方法)