#15683 [Opn->Csd]: "addslashes" mis-recognises chinese-big5 words with "0xXX 0x5C"

From: Date: Fri, 16 Aug 2002 14:23:58 +0000
Subject: #15683 [Opn->Csd]: "addslashes" mis-recognises chinese-big5 words with "0xXX 0x5C"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17020@lists.php.net to get a copy of this message
ID: 15683 Updated by: kalowsky@php.net Reported By: leochang@blissfountain.com -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: ALL PHP Version: 4.1.1 New Comment: From my understanding the mbstring handles this, and if not the script added below by ks_meng should do the trick. Marking this as closed, but if you feel this is insufficenet please reopen the bug. Previous Comments: ------------------------------------------------------------------------ [2002-08-16 04:02:10] ksmeng_1999@yahoo.com 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; } ------------------------------------------------------------------------ [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

« previous php.bugs (#17020) next »