note 80591 added to function.strtr
| From: | troelskn at gmail dot com | Date: | Wed, 23 Jan 2008 23:39:47 +0000 |
| Subject: | note 80591 added to function.strtr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135356@lists.php.net to get a copy of this message | ||
Here's another transcribe function. This one converts cp1252 (aka. Windows-1252) into
iso-8859-1 (aka. latin1, the default PHP charset). It only transcribes the few exotic characters,
which are unique to cp1252.
function transcribe_cp1252_to_latin1($cp1252) {
return strtr(
$cp1252,
array(
"\x80" => "e", "\x81" => " ",
"\x82" => "'", "\x83" => 'f',
"\x84" => '"', "\x85" => "...",
"\x86" => "+", "\x87" => "#",
"\x88" => "^", "\x89" => "0/00",
"\x8A" => "S", "\x8B" => "<",
"\x8C" => "OE", "\x8D" => " ",
"\x8E" => "Z", "\x8F" => " ",
"\x90" => " ", "\x91" => "`",
"\x92" => "'", "\x93" => '"',
"\x94" => '"', "\x95" => "*",
"\x96" => "-", "\x97" => "--",
"\x98" => "~", "\x99" => "(TM)",
"\x9A" => "s", "\x9B" => ">",
"\x9C" => "oe", "\x9D" => " ",
"\x9E" => "z", "\x9F" => "Y"));
----
Server IP: 216.92.131.65
Probable Submitter: 90.184.165.105
----
Manual Page -- http://www.php.net/manual/en/function.strtr.php
Edit -- https://master.php.net/note/edit/80591
Del: integrated -- https://master.php.net/note/delete/80591/integrated
Del: useless -- https://master.php.net/note/delete/80591/useless
Del: bad code -- https://master.php.net/note/delete/80591/bad+code
Del: spam -- https://master.php.net/note/delete/80591/spam
Del: non-english -- https://master.php.net/note/delete/80591/non-english
Del: in docs -- https://master.php.net/note/delete/80591/in+docs
Del: other reasons-- https://master.php.net/note/delete/80591
Reject -- https://master.php.net/note/reject/80591
Search -- https://master.php.net/manage/user-notes.php