Forum


Replies: 8   Views: 3801
Utf-8 issues
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 Squad internet  · 12-10-2012 - 14:08

Hi guys,

I'm having a serious issue here and I don't know how to fix it.
I narrowed it down quite a bit and it comes to the following:

I have a html entitity (using a space between & and uuml; as I can't get it display properly ):
[code]
& uuml; => ü
[/code]

And I wanna write that to the document, the following options I tried (and failed)



[code]
$docx->addText(html_enties_decode('& uuml;'); // fails
$docx->addText(utf8_encode('& uuml;'); // fails
[/code]

When however I do the folllowing:
[code]
echo utf8_encode('& uuml;');
// Copy & paste the result from my browser into the following code:
$docx->addText('ü');
[/code]

It works,...

What is going on, what am I doing wrong?