note 106744 added to function.utf8-decode
| From: | (maxxpreston) | Date: | Sat, 03 Dec 2011 00:29:26 +0000 |
| Subject: | note 106744 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184877@lists.php.net to get a copy of this message | ||
@mkluczka I think there is wrong "Å" and "Å" UTF8 position in your array.
Here's your function jquery2iso with fix
function jquery2iso($in)
{
$CONV = array();
$CONV['c4']['85'] = 'Ä
';
$CONV['c4']['84'] = 'Ä';
$CONV['c4']['87'] = 'Ä';
$CONV['c4']['86'] = 'Ä';
$CONV['c4']['99'] = 'Ä';
$CONV['c4']['98'] = 'Ä';
$CONV['c5']['82'] = 'Å';
$CONV['c5']['81'] = 'Å';
$CONV['c5']['84'] = 'Å'; //fix
$CONV['c5']['83'] = 'Å'; //fix
$CONV['c3']['b3'] = 'ó';
$CONV['c3']['93'] = 'Ã';
$CONV['c5']['9b'] = 'Å';
$CONV['c5']['9a'] = 'Å';
$CONV['c5']['ba'] = 'ź';
$CONV['c5']['b9'] = 'Ź';
$CONV['c5']['bc'] = 'ż';
$CONV['c5']['bb'] = 'Å»';
$i=0;
$out = '';
while($i<strlen($in))
{
if(array_key_exists(bin2hex($in[$i]), $CONV))
{
$out .= $CONV[bin2hex($in[$i])][bin2hex($in[$i+1])];
$i += 2;
}
else
{
$out .= $in[$i];
$i += 1;
}
}
return $out;
}
----
Server IP: 69.147.83.197
Probable Submitter: 78.8.204.133
----
Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php
Edit -- https://master.php.net/note/edit/106744
Del: integrated -- https://master.php.net/note/delete/106744/integrated
Del: useless -- https://master.php.net/note/delete/106744/useless
Del: bad code -- https://master.php.net/note/delete/106744/bad+code
Del: spam -- https://master.php.net/note/delete/106744/spam
Del: non-english -- https://master.php.net/note/delete/106744/non-english
Del: in docs -- https://master.php.net/note/delete/106744/in+docs
Del: other reasons-- https://master.php.net/note/delete/106744
Reject -- https://master.php.net/note/reject/106744
Search -- https://master.php.net/manage/user-notes.php