This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Mistake in charset detection with patch

description

Hi,

In HTMLWeb.cs, in
    private HttpStatusCode Get(Uri uri, string method, string path, HtmlDocument doc, IWebProxy proxy,
                               ICredentials creds)
There is :
            Encoding respenc = !string.IsNullOrEmpty(resp.ContentEncoding)
                                   ? Encoding.GetEncoding(resp.ContentEncoding)
                                   : null;
            if (OverrideEncoding != null)
                respenc = OverrideEncoding;
It should be :
            Encoding respenc = !string.IsNullOrEmpty(resp.CharacterSet)
                                   ? Encoding.GetEncoding(resp.CharacterSet)
                                   : null;
            if (OverrideEncoding != null)
                respenc = OverrideEncoding;
Since ContentEncoding is only for compression purposes.

comments