phpwkhtmltopdf: Problems for printing UTF-8 characters on footer/ header
I am now generating PDF with Chinese characters on both its header and footer:
$title = '中文字';
$options = array(
'encoding' => 'UTF-8', // option with argument
'header-left' => $title,
'footer-html' => 'footer.html',
'replace' => array(
'title' =>$title
),
);
Currently, the header can print out the characters fine, but for the footer, that I include an external html file for it and pass it through replace, the characters printed out becomes unrecognizable.
I already have
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
inside the head tag of my footer.html file. How can I solve this? Thank you very much.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 21 (11 by maintainers)
Commits related to this issue
- Issue #108: Add note about LANG env var for UTF-8 arguments — committed to mikehaertl/phpwkhtmltopdf by mikehaertl 9 years ago
@newpen Can you try adding this line somewhere on top of your script:
I could reproduce the issue and this fixed it. I will try to include this in https://github.com/mikehaertl/php-shellcommand.
Had no time to reproduce yet. But this is rather a problem of https://github.com/mikehaertl/php-shellcommand.
I’ve opened the above issue there. What could work: pass a
LANGenvironment variable toproc_open: