Difference between #21 and #22 of
How to set up Unicode

Revision #22 has been created by fsb on Dec 27, 2011, 12:39:40 PM with the memo:

strlen() and mbstring.func_overload
« previous (#21) next (#23) »

Changes

Title unchanged

How to set up Unicode

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

i18n, unicode

Content changed

[...]
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)
19 0
14 followers
Viewed: 135 813 times
Version: 1.1
Category: How-tos
Tags: i18n, unicode
Written by: Mike
Last updated by: Roman Solomatin
Created on: Feb 21, 2009
Last updated: 10 years ago
Update Article

Revisions

View all history