How to set up Unicode

Comparing #21 with #22

Revision #22 was created by fsb fsb on Dec 27, 2011, 12:39:40 PM.

strlen() and mbstring.func_overload

Content

[...]
php_admin_value mbstring.internal_encoding "UTF-8"
~~~

>Note: Unfortunately it's not recommended to set this an an `.htaccess` file as this may lead to undefined behavior.

When mbstring function overloading is turned on the built-in PHP function `strlen()` counts Unicode characters, not bytes, and the change can break existing code. Use `mb_string($str, 'ISO-8859-1')` to find the byte length of `$str`.
 
 
### Links [Chinese version](http://projects.ourplanet.tk/node/84)