how to change HtmlWeb encoding

c# html-agility-pack windows-phone-7

Question

I am trying to load a webpage for a windows phone app using the htmlagilitypack, the problem is that the encoding is iso-8859-7 and the htmlWeb class loads the page as a utf. I try to solve this with the following code:

 public auditPage()
        {
            InitializeComponent();
            HtmlWeb hwWeb = new HtmlWeb();
            hwWeb = new HtmlWeb
            {
                AutoDetectEncoding = false,
                OverrideEncoding = Encoding.GetEncoding("iso-8859-7"),
            };
           HtmlWeb.LoadAsync("url", HtmlWeb_load);
        }

But i get the following errors : 'HtmlAgilityPack.HtmlWeb' does not contain a definition for 'OverrideEncoding' 'HtmlAgilityPack.HtmlWeb' does not contain a definition for 'AutoDetectEncoding'. What can i do to encode the html page correctly ?

Popular Answer

Autodetectencoding was added in one of the latest versions and is maybe not available in the version you've added to the project. Version 1.4.0 has this property.

See also: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/b2733aa5-99dc-4bcc-a3b8-ea0754f494e0/




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why