|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-02-23 02:21 UTC] leochang at blissfountain dot 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!!!!! PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 17:00:02 2025 UTC |
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; }