Jeckky / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Utf-8 char € not displayed #388

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
€ gets converted to ?
the other utf8 chars work, though (äöüßÄÖÜ)

Original issue reported on code.google.com by dereurom...@gmail.com on 8 Dec 2011 at 4:37

GoogleCodeExporter commented 9 years ago
Which version of dompdf? Are you specifying a document encoding?

Original comment by eclecticgeek on 8 Dec 2011 at 8:00

GoogleCodeExporter commented 9 years ago
Have you tried using the HTML entity € instead? I always use £ € etc. as I 
find it's more reliable (also I use the same templates for HTML and PDF output).

Original comment by p...@xk7.net on 13 Dec 2011 at 11:52

GoogleCodeExporter commented 9 years ago
well, the whole document (layout, view) is utf-8 (And yes, I specify it) - the 
html views are fine, but on "print" the pdf views are messed up... and the data 
partly comes from the DB. so it is difficult (due to html) to substitute it. 
htmlentities() also works but would need to be applied to the single utf8 chars 
via some kind of preg_replace prior to letting dompdf render the doc.

one other thing:
I need to use utf8_decode to pass my utf8 data. otherwise its double encoded...
$dompdf->load_html(utf8_decode($html), 'UTF-8');

so this issue might be related.

Original comment by dereurom...@gmail.com on 13 Dec 2011 at 4:19

GoogleCodeExporter commented 9 years ago
essentially - this works:
$dompdf->load_html(utf8_decode(str_replace('€', '€', $html)), 'UTF-8');
but its not beautiful...

Original comment by dereurom...@gmail.com on 13 Dec 2011 at 4:25

GoogleCodeExporter commented 9 years ago
There was a double-encoding error, but I'm pretty sure it has been addressed in 
0.6.0 beta 2.

Can you make sure your print view HTML is correct. You can do this by calling 
$dompdf->output_html(); This will return the HTML dompdf is processing.

Original comment by eclecticgeek on 15 Dec 2011 at 10:22

GoogleCodeExporter commented 9 years ago
no updates in a while, will re-open if new information is forthcoming

Original comment by eclecticgeek on 16 Apr 2012 at 10:11

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16