Replies: 5   Views: 3093
Utf-8 and language
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 bernhardh  · 06-06-2012 - 11:03


I have made a test document.php:

require_once '../phpdocx/classes/';

$docx = new CreateDocx();
$text = 'Ü - ä - ßberschrift Lorem ipsum dolor sit amet, consectetur adipisicing elit';

$paramsText = array(
'b' => 'single',
'font' => 'Arial'
$docx->addText($text, $paramsText);

The file is saved as UTF-8.

But the created Docx has wrong letters in it:

Ü - ä - ß - Ö - berschrift Lorem ipsum dolor sit amet, consectetur adipisicing elit

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


If you are using an UTF8 editor, please remove $docx->setEncodeUTF8(); line.


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

Thanks, it works...

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

Ok, we have now bought pro version and if we use umlauts in addText it works, but if we use the same string in addHTML we get wired symbols??

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

Ok, i solved the problem myself...
I have to use a full html structure including <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> and not only some html snippets..