Forum


Replies: 10   Views: 4129
Utf8 support
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by js  · 11-04-2013 - 12:13

Hi,

I am facing a problem which seem to be related to the original one in that post. System environment is fully UTF8 compliant and other parts of the system are woring with UTF8 as expected (e. g. PHPexcel). I am using PHPdocx v2.6 pro.

When I create a docx file using a template like that:
[code]
$docx = new CreateDocx();
// Set Encoding
// $docx->setEncodeUTF8();
// Add Template
$docx->addTemplate('template_files/001.docx');

$docx->addTemplateVariable('MYVAR01', $params['MYVAR01']);

...
[/code]
German Umlauts like äüö are displayed as they should. However when I add some japanese chars like "おはようございます! " they look like that: "おはようございます!" in the docx file.
If I enable the setEncodeUTF8() function the German Umlauts are no longer displayed in the right way and the above chars look like that: "おはようございます!"

Any suggestions / howto's on that topic which explain how to use UTF8 chars within phpdocx would be helpfull.