note 58790 added to function.mb-strtolower
| From: | btherl at yahoo dot com dot au | Date: | Wed, 16 Nov 2005 05:12:47 +0000 |
| Subject: | note 58790 added to function.mb-strtolower | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98637@lists.php.net to get a copy of this message | ||
If you use this function on a unicode string without telling PHP that it is unicode, then you will
corrupt your string. In particular, the uppercase 'A' with tilde, common in 2-byte UTF-8
characters, is converted to lowercase 'a' with tilde.
This can be handled correctly by:
$str = mb_strtolower($str, mb_detect_encoding($str));
Or if you know your data is UTF-8, just use the string "UTF-8" as the second argument.
You should check also that mb_detect_encoding() is checking the encodings you want it to check, and
is detecting the correct encodings.
----
Manual Page -- http://www.php.net/manual/en/function.mb-strtolower.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58790
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58790&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58790&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58790&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58790&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58790&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58790&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58790&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58790&report=yes
Search -- http://master.php.net/manage/user-notes.php