note 73736 deleted from function.utf8-decode by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 11:30:42 +0000 |
| Subject: | note 73736 deleted from function.utf8-decode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208527@lists.php.net to get a copy of this message | ||
Note Submitter: ahmed dot adaileh at gmail dot com
----
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.