CsQuery中文编码乱码问题
程序员文章站
2022-07-05 18:51:01
一、问题描述 InnerHTML 中文显示为Модель 二、解决方法 在初始化CQ对象前,先设置执行以下语句: CsQuery.Config.HtmlEncoder = CsQuery.HtmlEncoders.None; C... ......
一、问题描述
InnerHTML 中文显示为Модель
二、解决方法
在初始化CQ对象前,先设置执行以下语句:
CsQuery.Config.HtmlEncoder = CsQuery.HtmlEncoders.None;
CsQuery.Config.OutputFormatter = CsQuery.OutputFormatters.HtmlEncodingNone;
详细代码如下:
CsQuery.Config.HtmlEncoder = CsQuery.HtmlEncoders.None; CsQuery.Config.OutputFormatter = CsQuery.OutputFormatters.HtmlEncodingNone; CsQuery.CQ document = CsQuery.CQ.CreateDocument(html); try { CQ cq = document["div a"]; listViewResult.Items.Clear(); foreach (IDomObject dom in cq) { listViewResult.Items.Add(dom.InnerHtml); } } catch (Exception ex) { MessageBox.Show(ex.Message, "错误提示"); }
--版权信息--
转载请标明文章出版,谢谢!
文章作者:易几 http://www.cnblogs.com/InfoStudio/
--版权信息--
推荐阅读
-
ubuntu系统下matplotlib中文乱码问题的解决方法
-
PL/SQL Oracle客户端出现中文乱码问题解决办法
-
关于Cookie中带有中文乱码报错的问题解决
-
Three.js使用THREE.TextGeometry创建三维文本中文乱码的问题如何解决?
-
解决asp.net core在输出中文时乱码的问题
-
解决3.01版的jquery.form.js中文乱码问题的解决方法
-
解决python3 HTMLTestRunner测试报告中文乱码的问题
-
通过过滤器(Filter)解决JSP的Post和Request中文乱码问题
-
JSP利用过滤器解决request中文乱码问题
-
解决页面中文乱码问题解析