note 73639 deleted from function.utf8-decode by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 11:30:29 +0000 |
| Subject: | note 73639 deleted from function.utf8-decode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208526@lists.php.net to get a copy of this message | ||
Note Submitter: fananf at nerdshack dot com
----
Comment to AJGORS reply from 28-Dec-2006 02:38:
You have used twice "ż" instead of "ź".
Correct code should be:
ISO version:
function utf82iso88592($text) {
$text = str_replace("\xC4\x85", '±', $text);
$text = str_replace("\xC4\x84", 'Ë', $text);
$text = str_replace("\xC4\x87", 'Ä', $text);
$text = str_replace("\xC4\x86", 'Ä', $text);
$text = str_replace("\xC4\x99", 'Ä', $text);
$text = str_replace("\xC4\x98", 'Ä', $text);
$text = str_replace("\xC5\x82", 'Å', $text);
$text = str_replace("\xC5\x81", 'Å', $text);
$text = str_replace("\xC3\xB3", 'ó', $text);
$text = str_replace("\xC3\x93", 'Ã', $text);
$text = str_replace("\xC5\x9B", '¶', $text);
$text = str_replace("\xC5\x9A", '¦', $text);
$text = str_replace("\xC5\xBC", 'ż', $text);
$text = str_replace("\xC5\xBB", 'Å»', $text);
$text = str_replace("\xC5\xBA", 'Ľ', $text);
$text = str_replace("\xC5\xB9", '¬', $text);
$text = str_replace("\xc5\x84", 'Å', $text);
$text = str_replace("\xc5\x83", 'Å', $text);
return $text;
}
CP version:
function utf82iso88592($text) {
$text = str_replace("\xC4\x85", 'Ä
', $text);
$text = str_replace("\xC4\x84", 'Ä', $text);
$text = str_replace("\xC4\x87", 'Ä', $text);
$text = str_replace("\xC4\x86", 'Ä', $text);
$text = str_replace("\xC4\x99", 'Ä', $text);
$text = str_replace("\xC4\x98", 'Ä', $text);
$text = str_replace("\xC5\x82", 'Å', $text);
$text = str_replace("\xC5\x81", 'Å', $text);
$text = str_replace("\xC3\xB3", 'ó', $text);
$text = str_replace("\xC3\x93", 'Ã', $text);
$text = str_replace("\xC5\x9B", 'Å', $text);
$text = str_replace("\xC5\x9A", 'Å', $text);
$text = str_replace("\xC5\xBC", 'ż', $text);
$text = str_replace("\xC5\xBB", 'Å»', $text);
$text = str_replace("\xC5\xBA", 'ź', $text);
$text = str_replace("\xC5\xB9", 'Ź', $text);
$text = str_replace("\xc5\x84", 'Å', $text);
$text = str_replace("\xc5\x83", 'Å', $text);
return $text;
}