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.