From 542f1705ba1355cad5192abfa5c5a5c4ee307a78 Mon Sep 17 00:00:00 2001 From: Zheng Zhu Date: Mon, 29 Nov 2004 02:14:54 +0000 Subject: [PATCH] correct parsing of info line for CONV ALL query --- includes/ZhClient.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/ZhClient.php b/includes/ZhClient.php index 3982ca6220..e07908db9d 100644 --- a/includes/ZhClient.php +++ b/includes/ZhClient.php @@ -110,9 +110,11 @@ class ZhClient { $info = explode(";", $infoline); $ret = array(); $i=0; - foreach($info as $code => $len) { + foreach($info as $variant) { + list($code, $len) = explode(' ', $variant); $ret[strtolower($code)] = substr($data, $i, $len); - $i+=$len+1; + $r = $ret[strtolower($code)]; + $i+=$len; } return $ret; } @@ -250,7 +252,7 @@ class ZhClientFake { * @access public */ function segment($text) { - /* adapted 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 */ -- 2.20.1