note 81599 added to function.utf8-decode
| From: | lukasz dot mlodzik at gmail dot com | Date: | Wed, 05 Mar 2008 12:46:58 +0000 |
| Subject: | note 81599 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136765@lists.php.net to get a copy of this message | ||
Update to MARC13 function utf2iso()
I'm using it to handle AJAX POST calls.
Despite using
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded';
charset='utf-8');
it still code Polish letters using UTF-16
This is only for Polish letters:
<?php
function utf16_2_utf8 ($nowytekst) {
$nowytekst = str_replace('%u0104','Ä',$nowytekst); //Ä
$nowytekst = str_replace('%u0106','Ä',$nowytekst); //Ä
$nowytekst = str_replace('%u0118','Ä',$nowytekst); //Ä
$nowytekst = str_replace('%u0141','Å',$nowytekst); //Å
$nowytekst = str_replace('%u0143','Å',$nowytekst); //Å
$nowytekst = str_replace('%u00D3','Ã',$nowytekst); //Ã
$nowytekst = str_replace('%u015A','Å',$nowytekst); //Å
$nowytekst = str_replace('%u0179','Ź',$nowytekst); //Ź
$nowytekst = str_replace('%u017B','Å»',$nowytekst); //Å»
$nowytekst = str_replace('%u0105','Ä
',$nowytekst); //Ä
$nowytekst = str_replace('%u0107','Ä',$nowytekst); //Ä
$nowytekst = str_replace('%u0119','Ä',$nowytekst); //Ä
$nowytekst = str_replace('%u0142','Å',$nowytekst); //Å
$nowytekst = str_replace('%u0144','Å',$nowytekst); //Å
$nowytekst = str_replace('%u00F3','ó',$nowytekst); //ó
$nowytekst = str_replace('%u015B','Å',$nowytekst); //Å
$nowytekst = str_replace('%u017A','ź',$nowytekst); //ź
$nowytekst = str_replace('%u017C','ż',$nowytekst); //ż
return ($nowytekst);
}
?>
Everything goes smooth, but it doesn't change '%u00D3','Ã' and
'%u00F3','ó'. I dont have idea what to do with that.
Remember! File must be saved in UTF-8 coding.
----
Server IP: 82.177.164.100
Probable Submitter: 83.29.80.8
----
Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php
Edit -- https://master.php.net/note/edit/81599
Del: integrated -- https://master.php.net/note/delete/81599/integrated
Del: useless -- https://master.php.net/note/delete/81599/useless
Del: bad code -- https://master.php.net/note/delete/81599/bad+code
Del: spam -- https://master.php.net/note/delete/81599/spam
Del: non-english -- https://master.php.net/note/delete/81599/non-english
Del: in docs -- https://master.php.net/note/delete/81599/in+docs
Del: other reasons-- https://master.php.net/note/delete/81599
Reject -- https://master.php.net/note/reject/81599
Search -- https://master.php.net/manage/user-notes.php