Having HTML2PDF encoded æøå characters
$content = "ÆØÅ";
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html2pdf->writeHTML($content, false)
$html2pdf->Output('', 'S'));
Gives me a pdf file with "Ã † Ã ~ Ã"
I checked the encoding in html2pdf.class.php and it is set to UTF-8, which should be accurate.
I tried changing 'en' to 'da' (Danish), all the same result.
How can i fix this? Spent hours now look ..
It looks like you are specifying the wrong encoding of the output. The conclusion is typical of what you get if you try to show the output of UTF-8 as ISO8859-1, for example.
It looks like the HTML2PDF constructor also has a version that accepts character encoding as a parameter:
$html2pdf = new HTML2PDF('P','A4','da', true, 'UTF-8');
can work...