Forum


Replies: 5   Views: 3111
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

Hello,

I have made a test document.php:

[code]
require_once '../phpdocx/classes/CreateDocx.inc';

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

$paramsText = array(
'b' => 'single',
'font' => 'Arial'
);
$docx->addText($text, $paramsText);
$docx->createDocx('example_text');
[/code]

The file is saved as UTF-8.

But the created Docx has wrong letters in it:

[code]
Ü - ä - ß - Ö - berschrift Lorem ipsum dolor sit amet, consectetur adipisicing elit
[/code]