CsQuery icon indicating copy to clipboard operation
CsQuery copied to clipboard

Unable to do comparison with Chinese text

Open eloitay opened this issue 10 years ago • 0 comments

Hi This is my code sample, I had removed the site that I tested the code against since it is some intranet environment. So basically what I notice is the comparison is not matching due to the InnerText being encoded. So I tried to use decoding method from .NET framework and HTMLAgilityPack but it does not seem to decode to the correct original Chinese text. Any clue what is missing here?

var cq = CQ cq = CQ.CreateFromUrl("www.google.com"); var lastPage = cq["a"].Where(x => x.InnerText == "尾页");

I tried something like this var lastPage = cq["a"].Where(x => System.Net.WebUtility.HtmlDecode(x.InnerText) == "尾页");

eloitay avatar May 29 '14 09:05 eloitay