note 37694 added to function.utf8-decode
| From: | nospam at jra dot nu | Date: | Sun, 23 Nov 2003 08:48:23 +0000 |
| Subject: | note 37694 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60869@lists.php.net to get a copy of this message | ||
There is an error in the 'smart_utf8_decode' function posted by '
goran_johansson' below. It should look like this:
function smart_utf8_decode($in_str)
{
// Replace ? with a unique string
$new_str = str_replace("?", "q0u0e0s0t0i0o0n", $in_str);
// Try the utf8_decode
$new_str=utf8_decode($new_str);
// if it contains ? marks
if (strpos($new_str,"?")>0)
{
// Something went wrong, set new_str to the original string.
$new_str=$in_str;
}
else
{
// If not then all is well, put the ?-marks back where is belongs
$new_str = str_replace("q0u0e0s0t0i0o0n", "?", $new_str);
}
return $new_str;
}
----
Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37694
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37694&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37694&report=yes
Search -- http://master.php.net/manage/user-notes.php