Forum


Replies: 8   Views: 3773
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  · 11-04-2013 - 12:13

Hi,

Thanks for your reply.
My editor is set to UTF8, it really is, my database cols are set to utf8, but some of the contents might not actually be utf8 . In theory this however shouldn't be a serious problem, I should be able to encode it to utf8.

The issue here is (I think) the utf8_encode() method in php,.. I do believe it is rather buggy as I also was required to change the internal encoding of php to utf8 to store strings in memory as utf8 as encoding seemed to take place while outputting to the browser and the encoded string did not reside in memory as a multi-byte char, I think the utf8encode() only encodes the required chars (ea. htmlenties) to the proper encoding or something like that, else my issue wouldn't exist. I might try iconv() to encode after a while.. but the issue is fixed for now.

It might be a nice addon to the tutorial section about how to change the encoding in php in a proper way, as most of the scripts using this lib will be using database data that has been harvested using some kind of web-form.
Encoding in php is a really dark corner of the language, I hope this will change soon but for now,...


Thanks for your help in this issue, if I have a better solution to the issue (better than a str_replace()), I will reply to this post.