note 37747 added to function.utf8-decode

From: Date: Tue, 25 Nov 2003 12:12:36 +0000
Subject: note 37747 added to function.utf8-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-60964@lists.php.net to get a copy of this message
Correction to function converting utf82iso88592 and iso88592tutf8. Janusz forgot about "ń", and "ż" exchanged from "ź" here and there. GTo function utf82iso88592($tekscik) { $tekscik = str_replace("\xC4\x85", "ą", $tekscik); $tekscik = str_replace("\xC4\x84", 'Ą', $tekscik); $tekscik = str_replace("\xC4\x87", 'ć', $tekscik); $tekscik = str_replace("\xC4\x86", 'Ć', $tekscik); $tekscik = str_replace("\xC4\x99", 'ę', $tekscik); $tekscik = str_replace("\xC4\x98", 'Ę', $tekscik); $tekscik = str_replace("\xC5\x82", 'ł', $tekscik); $tekscik = str_replace("\xC5\x81", 'Ł', $tekscik); $tekscik = str_replace("\xC5\x84", 'ń', $tekscik); $tekscik = str_replace("\xC5\x83", 'Ń', $tekscik); $tekscik = str_replace("\xC3\xB3", 'ó', $tekscik); $tekscik = str_replace("\xC3\x93", 'Ó', $tekscik); $tekscik = str_replace("\xC5\x9B", 'ś', $tekscik); $tekscik = str_replace("\xC5\x9A", 'Ś', $tekscik); $tekscik = str_replace("\xC5\xBC", 'ż', $tekscik); $tekscik = str_replace("\xC5\xBB", 'Ż', $tekscik); $tekscik = str_replace("\xC5\xBA", 'ź', $tekscik); $tekscik = str_replace("\xC5\xB9", 'Ź', $tekscik); return $tekscik; } // utf82iso88592 function iso885922utf8($tekscik) { $tekscik = str_replace("ą", "\xC4\x85", $tekscik); $tekscik = str_replace('Ą', "\xC4\x84", $tekscik); $tekscik = str_replace('ć', "\xC4\x87", $tekscik); $tekscik = str_replace('Ć', "\xC4\x86", $tekscik); $tekscik = str_replace('ę', "\xC4\x99", $tekscik); $tekscik = str_replace('Ę', "\xC4\x98", $tekscik); $tekscik = str_replace('ł', "\xC5\x82", $tekscik); $tekscik = str_replace('Ł', "\xC5\x81", $tekscik); $tekscik = str_replace('ń', "\xC5\x84", $tekscik); $tekscik = str_replace('Ń',"\xC5\x83", $tekscik); $tekscik = str_replace('ó', "\xC3\xB3", $tekscik); $tekscik = str_replace('Ó', "\xC3\x93", $tekscik); $tekscik = str_replace('ś', "\xC5\x9B", $tekscik); $tekscik = str_replace('Ś', "\xC5\x9A", $tekscik); $tekscik = str_replace('ż', "\xC5\xBC", $tekscik); $tekscik = str_replace('Ż', "\xC5\xBB", $tekscik); $tekscik = str_replace('ź', "\xC5\xBA", $tekscik); $tekscik = str_replace('Ź', "\xC5\xB9", $tekscik); return $tekscik; } // iso885922utf8 ---- Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37747 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37747&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37747&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60964) next »