From: Zheng Zhu Date: Mon, 22 Nov 2004 22:10:34 +0000 (+0000) Subject: segment() should only do segmentation, and let the caller do the conversion to hex. X-Git-Tag: 1.5.0alpha1~1267 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=57db65ee9a8a0026fc5d42a191174dec960d6d59;p=lhc%2Fweb%2Fwiklou.git segment() should only do segmentation, and let the caller do the conversion to hex. --- diff --git a/includes/ZhClient.php b/includes/ZhClient.php index b9a93463ea..7e775e397f 100644 --- a/includes/ZhClient.php +++ b/includes/ZhClient.php @@ -252,17 +252,20 @@ class ZhClientFake { * @access public */ function segment($text) { - /* copied from LanguageZh_cn.stripForSearch() */ + /* adapted from LanguageZh_cn.stripForSearch() + here we will first separate the single characters, + and let the caller conver it to hex + */ if( function_exists( 'mb_strtolower' ) ) { return preg_replace( "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", - "' U8' . bin2hex( \"$1\" )", + "' ' .\"$1\"", mb_strtolower( $text ) ); } else { global $wikiLowerChars; return preg_replace( "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", - "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )", + "' ' . strtr( \"\$1\", \$wikiLowerChars )", $text ); } }