note 73736 added to function.utf8-decode
| From: | ahmed dot adaileh at gmail dot com | Date: | Thu, 08 Mar 2007 11:32:17 +0000 |
| Subject: | note 73736 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124229@lists.php.net to get a copy of this message | ||
I searched a lot everywhere to find a suitable function which converts my UTF8 characters to the
windows-1250 charset for Polish language, but couldn't find anything :(
Following is a function which does that:
function show_polish ($text) {
$text = str_replace("Ãâ", 'Ą', $text); //Ä
$text = str_replace("Ãâ ", 'Ć', $text); //Ä
$text = str_replace("ÃË", 'Ę', $text); //Ä
$text = str_replace("Ã
Â", 'Ł', $text); //Å
$text = str_replace("Ã
Æ", 'Ń', $text); //Å
$text = str_replace("Ãâ", 'Ó', $text); //Ã
$text = str_replace("Ã
Å¡", 'Ś', $text); //Å
$text = str_replace("Ã
¹", 'Ź', $text); //Ź
$text = str_replace("Ã
»", 'Ż', $text); //Å»
$text = str_replace("Ãâ¦", 'ą', $text); //Ä
$text = str_replace("Ãâ¡", 'ć', $text); //Ä
$text = str_replace("Ãâ¢", 'ę', $text); //Ä
$text = str_replace("Ã
â", 'ł', $text); //Å
$text = str_replace("Ã
â", 'ń', $text); //Å
$text = str_replace("ó", 'ó', $text); //ó
$text = str_replace("Ã
âº", 'ś', $text); //Å
$text = str_replace("Ã
º", 'ź', $text); //ź
$text = str_replace("Ã
¼", 'ż', $text); //ż
return $text;
}
You can refer to http://hermes.umcs.lublin.pl/~awmarcz/awm/info/pl-codes.htm
if you want to use HTML hex. code rather than HTML dec. code which I used in my function.
----
Server IP: 217.160.72.57
Probable Submitter: 217.7.133.193 (proxied: 1.1 VADERS02)
----
Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php
Edit -- https://master.php.net/note/edit/73736
Del: integrated -- https://master.php.net/note/delete/73736/integrated
Del: useless -- https://master.php.net/note/delete/73736/useless
Del: bad code -- https://master.php.net/note/delete/73736/bad+code
Del: spam -- https://master.php.net/note/delete/73736/spam
Del: non-english -- https://master.php.net/note/delete/73736/non-english
Del: in docs -- https://master.php.net/note/delete/73736/in+docs
Del: other reasons-- https://master.php.net/note/delete/73736
Reject -- https://master.php.net/note/reject/73736
Search -- https://master.php.net/manage/user-notes.php