From 57db65ee9a8a0026fc5d42a191174dec960d6d59 Mon Sep 17 00:00:00 2001 From: Zheng Zhu Date: Mon, 22 Nov 2004 22:10:34 +0000 Subject: [PATCH] segment() should only do segmentation, and let the caller do the conversion to hex. --- includes/ZhClient.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 ); } } -- 2.20.1