Forum


Replies: 2   Views: 3560
Setencodeutf8 problems.
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 beauware  · 19-04-2013 - 18:04

I have been on this for the pass 2 days, so I am asking for help now.



I have a form, text boxes on it, and I use replaceTemplateVariableByHTML to place text in my document. Easy stuff, no special things here. In english, just fine, in french refuse to display the accents correctly in the word document generated. If I just break the code (die) and echo my form variable, the accents are fine in the php page.



I have look in Google every possible problems with UTF8 and I am ok since it display fine from a post form.



I have also scan this KB, and the solutions listed don't work for me. From what I understant it is with replaceTemplateVariableByHTML, addText seems to work.



What I have tried/added:



header('content-type: text/html; charset: utf-8');



setlocale(LC_ALL, 'fr_FR');



$docx->setEncodeUTF8();



$docx->setLanguage('fr-FR');



iconc, utf8_convert, mb_convert_encoding 



etc.


 


Thanks.


 



 



 


Posted by beauware  · 22-04-2013 - 04:48

As simple as that. That why nobody anwser. Have to use addTemplateVariable.



Took a few hours to finally switch to that.


 


Hope this help someone else.