note 76331 deleted from function.utf8-encode by nlopess
| From: | nlopess@php.net | Date: | Fri, 13 Jul 2007 19:25:08 +0000 |
| Subject: | note 76331 deleted from function.utf8-encode by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128492@lists.php.net to get a copy of this message | ||
Note Submitter: vita dot plachy at seznam dot cz
Reason: non-english
----
Tato funkce Åešà problém s pÅevodem Äeských znaků. Seznam je Åazen tak,
aby znaky s náhradami nekolidovaly.
<?php
function utf8_encode_cs($text)
{
$znaky=array(
array("Ä", 196, 155),
array("Å¡", 197, 161),
array("Å", 197, 153),
array("ý", 195, 189),
array("á", 195, 161),
array("Ã", 195, 173),
array("é", 195, 169),
array("ú", 195, 186),
array("ů", 197, 175),
array("Ä", 196, 143),
array("Å¥", 197, 165),
array("Å", 197, 136),
array("ó", 195, 179),
array("Ä", 196, 154),
array("Å ", 197, 160),
array("Ä", 196, 140),
array("Å", 197, 152),
array("Ã", 195, 129),
array("Ã", 195, 137),
array("Ť", 197, 164),
array("Å", 197, 135),
array("Ã", 195, 147),
array("Ã", 195, 157),
array("Ã", 195, 154),
array("Å®", 197, 174),
array("Ã", 195, 141),
array("ž", 197, 190),
array("Ž", 197, 189),
array("Ä", 196, 141),
array("Ä", 196, 142)
);
$text=utf8_encode($text);
for($i=0; $i<count($znaky); $i++)
$text=ereg_replace(utf8_encode($znaky[$i][0]), chr($znaky[$i][1]) . chr($znaky[$i][2]), $text);
return $text;
}
echo utf8_encode_cs("LoÄ ÄeÅà kýlem tůŠobzvlášť v Grónské
úžinÄ.");
?>