I’m getting the html from other page with problems in codification.
For example:
I getting:
aparelho nas sa??das
the original text is:
aparelho nas saídas
How I get the encoding and convert to original string?
My code:
var GetResponse = API_GET("..."); //this returns html of an http request.
HtmlDocument doc = new HtmlDocument(); //the html-parsing
doc.LoadHtml(GetResponse);
var body = doc.DocumentNode.SelectNodes("//div[@class='para']");
...
var para = body[i].InnerHtml; //Here's the problem,it returns the output like: sa??das
How I do this?
Thanks in advance
Use this – kind of does this. Checks for just utf-8. I think it’s hard to check for encoding.
http://utf8checker.codeplex.com/releases/view/40052
Here’s part of the source code. Look at the IsUtf8 Methods. Can be quite useful.