【问题标题】:wkhtmltopdf not converting quotes and spaces properlywkhtmltopdf 没有正确转换引号和空格
【发布时间】:2016-12-19 09:43:53
【问题描述】:

我正在使用这个 wkhtmltopdf 0.12.3 (with patched qt) 版本的 wkhtmltopdf。 使用Montserrat font-family。

HTML是这样的,

<strong>
    This Agreement for home staging and rental of furniture and accessories 
</strong>
(“Agreement”) is entered this 

输出为,

关于家居布置和家具租赁的协议 access ssorie s (â​​Agre e me ntâ​)

还有,

<u>Services</u>&nbsp; 
Subject to the terms and conditions of this </span>

输出为,

服务受本条款和条件的约束

为什么这些Â 介于两者之间?

我尝试过像这样替换引号和空格,

$formData = str_replace('&nbsp;', ' ', $formData);
$formData = str_replace('&quot;', '"', $formData);
$formData = str_replace('“', '"', $formData);
$formData = str_replace('”', '"', $formData);

但没有帮助。难道我做错了什么? 已搜索,但找不到解决方案。

【问题讨论】:

    标签: php wkhtmltopdf phpwkhtmltopdf


    【解决方案1】:

    在head标签后面写:

    <meta charset="UTF-8" />
    

    【讨论】:

    猜你喜欢
    • 2011-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多