wkhtmltopdf not converting quotes and spaces properly

1.1k Views Asked by At

I am using this wkhtmltopdf 0.12.3 (with patched qt) version of wkhtmltopdf. With Montserrat font-family.

The HTML is like this,

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

Which outputs as,

T his Agre e me nt f or home staging and re ntal of f urniture and acce ssorie s (â​​ Agre e me ntâ​​ )

And,

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

Which outputs as,

 Se rvice s Subje ct to the te rms and conditions of this

Why these  are comming in between?

I have tried to replace the quotes and spaces like this,

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

But didn't helped. Am I doing something wrong? Searched, but cannot find the solution.

1

There are 1 best solutions below

2
On

Write this after head tag:

<meta charset="UTF-8" />