得到一个€™编码错误与NRECO HTML到PDF [英] Getting ’ encoding errors with NRECO Html to Pdf

查看:163
本文介绍了得到一个€™编码错误与NRECO HTML到PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C#的NReco HTML到PDF转换的DLL,但它未能正确编码。的HTML是正确的渲染,但是当我渲染PDF,它未能在或字正确转换,我所知道的是编码。找人谁使用这个DLL并解决了这个问题,下面是我对HTML页面编码元

 < META HTTP-EQUIV =Content-Type的字符集=UTF-8/> 


解决方案

荟萃命令是错误的,它应该是

 < META HTTP-EQUIV =Content-Type的CONTENT =text / html的;字符集= UTF-8/> 

 <间的charset =UTF-8/> 

(没有HTTP的当量)。



请注意,但是,使用元命令的字符集是无法保证所需的字符集确实使用。实际的HTTP报头可覆盖此设置与它自己的字符集。



此外,关于你的评论,它的正确呈现,请注意,Web浏览器可以使用不同的算法来确定编码比DLL。纠正元命令可能会或可能不会帮助。


I am using the NReco Html to Pdf conversion dll for C# but it's failing to encode correctly. The html is rendering properly but when i render the pdf, it fails to convert the ' or " characters correctly which i know is encoding. Looking for someone who has used this dll and solved this issue, below is my encoding meta for the html page.

<meta http-equiv="Content-Type" charset="UTF-8" />

解决方案

The meta command is wrong. It should be either

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

or

<meta charset="UTF-8"/>

(with no http-equiv).

Note, however, that using a meta command for the charset is no guarantee that the desired charset is indeed used. The actual http header may override this setting with a charset of its own.

Also, with regards to your comment that it's rendered correctly, note that web browsers may use a different algorithm to determine the encoding than the dll. Correcting the meta command may or may not help.

这篇关于得到一个€™编码错误与NRECO HTML到PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆