note 37694 deleted from function.utf8-decode by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 11:34:58 +0000 |
| Subject: | note 37694 deleted from function.utf8-decode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208537@lists.php.net to get a copy of this message | ||
Note Submitter: nospam at jra dot nu
----
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,"?") !== false)
{
// 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;
}