'gzip,deflate' is not a supported encoding name

Topics: Developer Forum, Project Management Forum, User Forum
Jun 8, 2010 at 9:34 PM

When i try to use a website url compressed with gzip HtmlAgilityPack gives the following error.

 

Please try this in your GetDocLinks.cs code and see yourself!

            HtmlWeb hw = new HtmlWeb();
            string url = @"http://www.turk.internet.com/portal/yazigoster.php?yaziid=27557";
            HtmlDocument doc = hw.Load(url);

 

How can i solve this problem, any ideas please?

 

And here you can find the exact problem i have in here (and no solutions at all!)

http://htmlagilitypack.codeplex.com/Thread/View.aspx?ThreadId=22790

 

thanks

Jun 8, 2010 at 9:47 PM

Just change the following lines in HtmlWeb.cs - line 433

 

            if ((resp.ContentEncoding != null) && (resp.ContentEncoding.Length>0))
            {
                try
                {
                    respenc = System.Text.Encoding.GetEncoding(resp.ContentEncoding);
                }
                catch
                {
                    respenc = null;
                }
            }
            else
            {
                respenc = null;
            }

 

I hope this will be usefull...