note 49508 added to function.mb-decode-numericentity
| From: | dirkatcamindode at osu1 dot php dot net | Date: | Sun, 30 Jan 2005 17:51:53 +0000 |
| Subject: | note 49508 added to function.mb-decode-numericentity | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-84244@lists.php.net to get a copy of this message | ||
By use of function utf8_decode you'll get a problem with all extended chars above ISO-8859-1
charset. You can solve this problem by using the
function mb_encode_numericentity before:
// convert $text from UTF-8 to ISO-8859-1
$convmap = array(0xFF, 0x2FFFF, 0, 0xFFFF);
$text = mb_encode_numericentity($text, $convmap, "UTF-8");
$text = utf8_decode($text);
The second line encodes all extended chars below 0xFF, the third line converts the rest: 0x80 - 0xFF
----
Manual Page -- http://www.php.net/manual/en/function.mb-decode-numericentity.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49508
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49508&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49508&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49508&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49508&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49508&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49508&report=yes
Search -- http://master.php.net/manage/user-notes.php