HtmlAgilityPack - How to set custom encoding when loading pages
Is it possible to set custom encoding when loading pages with the method below? HtmlWeb hwWeb = new HtmlWeb(); HtmlDocument hd = hwWeb.load("myurl"); I want to set encoding to "iso-8859-9". I use C# 4.0 and WPF. Edit: The question has been answered on MSDN. I suppose you could try overriding the encoding in the HtmlWeb object. Try this: var web = new HtmlWeb { AutoDetectEncoding = false, OverrideEncoding = myEncoding, }; var doc = web.Load(myUrl); Note: It appears that the OverrideEncoding property was added to HTML agility pack in revision 76610 so it is not available in the current release