note 42677 added to function.htmlentities
| From: | m227 at poczta dot onet dot pl | Date: | Wed, 26 May 2004 07:00:53 +0000 |
| Subject: | note 42677 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70096@lists.php.net to get a copy of this message | ||
// tested with PHP 4.3.4, Apache 1.29
// function works like original htmlentities
// but preserves Polish characters encoded in CP-1250
// (Windows code page) from false conversion
// m227@poczta.onet.pl, 2004
function htmlentities1250($str)
{
// four chars does not need any conversion
// s
(9c), z (9f), Z (8f), S (8c)
$trans = array(
"³" => "\xb3", // "l-"
"¹" => "\xb9", // "a,"
"ê" => "\xea", // "e,"
"æ" => "\xe6", // "c`"
"ñ"=> "\xf1", // "n`"
"¿"=> "\xbf", // "z."
"¥" => "\xa5", // "A,"
"Æ" => "\xc6", // "C`"
"¯" => "\xaf", // "Z."
"Ê" => "\xca", // "E,"
"ó"=> "\xf3", // "o`"
"Ó"=> "\xd3", // "O`"
"£" => "\xa3", // "L-"
"Ñ"=> "\xd1" // "N`"
);
return strtr(htmlentities($str), $trans);
}
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42677
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42677&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42677&report=yes
Search -- http://master.php.net/manage/user-notes.php