I have a page whose label is db generated. I would like to export that page in which ever language the user wishes. Currently I have 2 languages, English and Japanese.
Its currently encoded in UTF-8 and everything displays correctly in the web browser, but displays the actual utf-8 characters when I tried to export in Japanese...
For example, you'll see things like "の契約" (minus spaces) instead of the actual Japanese characters ... の契約
Can someone please point me toward the right directions as to which PHP encoding/decoding functions I have to use to get this to work?
I tried testing the Japanese version of Yahoo.com on several html2php websites ( ie "http://www.htm2pdf.co.uk/" ) and none of them seems to be working as well.
I have also tried converting from utf-8 to several other encoding (utf-16, EUC-JP, ... ) using iconv() and outputting it via PDF_show_xy() but that did not work as well.
Exporting HTML to PDF in a different language.
Moderator: General Moderators
Re: Exporting HTML to PDF in a different language.
Try html_entity_decode(). It should make the Japanese characters display correctly, at least.
Re: Exporting HTML to PDF in a different language.
I tried using html_entity_deocde()
The PDF no longer prints out "の契約"... now its just gibberish. The PDF is probably translating the decoded entity wrong? maybe there's a adobe plug in that I'm suppose to install? I tried installing the Japanese Font Pack, but that did not work as well.
Code: Select all
...
$test_label = 'の契約';
$result = html_entity_decode($test_label, ENT_QUOTES, 'UTF-8')
PDF_show_xy($pdf, $result.": ".$order_date , SECTION_START_X+TEXT_LEFT_PADDING, 750+((SECTION_TITLE_BOX_HEIGHT-5)/2));
...