I made a code so download a page so uses the chunked encoding, but the result is not good - a ����� characters.
I looked at fiddler - there the characters are correct.
How can I get the correct characters with keeping stuff simple? (no manual parsing)
Or - how can I tell to the server so we not support this encoding?
Thanks in advance
Here is the code in C#
HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create("http://www.grad-nk.ru/arti/531.php"); var webResponse = (HttpWebResponse)webRequest.GetResponse(); using (Stream stream = webResponse.GetResponseStream()) { using (StreamReader streamReader = new StreamReader(stream)) { var content = streamReader.ReadToEnd(); } } Edit:
Here is the line so makes it work
using (StreamReader streamReader = new StreamReader(stream, Encoding.GetEncoding(webResponse.CharacterSet))) Thanks to wal!!!