note 81599 added to function.utf8-decode

From: 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

« previous php.notes (#136765) next »