note 75286 added to function.strtr
| From: | horak dot janATcentrum dot cz at osu1 dot php dot net | Date: | Tue, 22 May 2007 14:11:16 +0000 |
| Subject: | note 75286 added to function.strtr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126819@lists.php.net to get a copy of this message | ||
Here is a function to convert middle-european windows charset (cp1250) to the charset, that php
script is written in:
<?php
function cp1250_to_utf2($text){
$dict = array(chr(225) => 'á', chr(228) => 'ä', chr(232) =>
'Ä', chr(239) => 'Ä',
chr(233) => 'é', chr(236) => 'Ä', chr(237) =>
'Ã', chr(229) => 'ĺ', chr(229) => 'ľ',
chr(242) => 'Å', chr(244) => 'ô', chr(243) =>
'ó', chr(154) => 'Å¡', chr(248) => 'Å',
chr(250) => 'ú', chr(249) => 'ů', chr(157) =>
'ť', chr(253) => 'ý', chr(158) => 'ž',
chr(193) => 'Ã', chr(196) => 'Ã', chr(200) =>
'Ä', chr(207) => 'Ä', chr(201) => 'Ã',
chr(204) => 'Ä', chr(205) => 'Ã', chr(197) =>
'Ĺ', chr(188) => 'Ľ', chr(210) => 'Å',
chr(212) => 'Ã', chr(211) => 'Ã', chr(138) =>
'Å ', chr(216) => 'Å', chr(218) => 'Ã',
chr(217) => 'Ů', chr(141) => 'Ť', chr(221) =>
'Ã', chr(142) => 'Ž',
chr(150) => '-');
return strtr($text, $dict);
}
?>
----
Server IP: 212.24.129.51
Probable Submitter: 147.229.197.71
----
Manual Page -- http://www.php.net/manual/en/function.strtr.php
Edit -- https://master.php.net/note/edit/75286
Del: integrated -- https://master.php.net/note/delete/75286/integrated
Del: useless -- https://master.php.net/note/delete/75286/useless
Del: bad code -- https://master.php.net/note/delete/75286/bad+code
Del: spam -- https://master.php.net/note/delete/75286/spam
Del: non-english -- https://master.php.net/note/delete/75286/non-english
Del: in docs -- https://master.php.net/note/delete/75286/in+docs
Del: other reasons-- https://master.php.net/note/delete/75286
Reject -- https://master.php.net/note/reject/75286
Search -- https://master.php.net/manage/user-notes.php