#15683 [Com]: "addslashes" mis-recognises chinese-big5 words with "0xXX 0x5C"
| From: | ksmeng_1999 at yahoo dot com | Date: | Fri, 16 Aug 2002 08:02:11 +0000 |
| Subject: | #15683 [Com]: "addslashes" mis-recognises chinese-big5 words with "0xXX 0x5C" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16992@lists.php.net to get a copy of this message | ||
ID: 15683
Comment by: ksmeng_1999@yahoo.com
Reported By: leochang@blissfountain.com
Status: Open
Bug Type: Feature/Change Request
Operating System: ALL
PHP Version: 4.1.1
New Comment:
to properly escape chinese big5 character with "0xXX 0x5C", u may try
this function. this tested with chinese character xu3 and gong1. if it
doesnt work wif others, pls let me know. TQ
function addslashes2($string)
{
$str=ereg_replace("([^\xA1-\xFE])[\x5c]","\\1\\\\",$string);
$str=ereg_replace("'", "\\'", $str);
$str=ereg_replace("\"", "\\\"", $str);
return $str;
}
Previous Comments:
------------------------------------------------------------------------
[2002-07-10 06:25:37] yohgaki@php.net
As mbstring manual mentions, use EUC-TW or UTF-8 if you need to get it
working.
------------------------------------------------------------------------
[2002-07-07 13:17:22] derick@php.net
A feature request for the mbstring extension.
Derick
------------------------------------------------------------------------
[2002-02-23 02:38:19] wandering@cyberdude.com
magic-quote is another function that creates the problem....
Addslashes is a php function that adds a slash in front of ' (single
quotes), " (double-quotes), and \ (back slashes) which makes
Traditional Chinese words display improperly when parsing the string.
They thought the chinese word to be quoted or something like that...
------------------------------------------------------------------------
[2002-02-23 02:21:21] leochang@blissfountain.com
"addslashes" and others always mis-recognise and display chinese
big5-code words with the character "0xXX 0x5C" by adding slashes into
the words....
which makes Traditional Chinese words can never be displayed properly
within php...
it's very inconvenient for all traditional Chinese users
Can anyone help?
Someone suggests adding codes of procedure for identifying whether the
words are in chinese-big-5 code or not before addslashes and other
work...
If that is a practical method, could someone make this "patch" for us
chinese linux php users?
If that's not too complicated even for php-developers, could you guys
please consider this in your future versions????
Please help!!!!!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15683&edit=1