Merge remote-tracking branch 'remotes/origin/master' into release/4.5
Showing
1 changed file
with
4 additions
and
4 deletions
@@ -1736,8 +1736,8 @@ class HelperSearch | @@ -1736,8 +1736,8 @@ class HelperSearch | ||
1736 | */ | 1736 | */ |
1737 | public static function pinYin($zh){ | 1737 | public static function pinYin($zh){ |
1738 | $ret = ""; | 1738 | $ret = ""; |
1739 | - @$s1 = iconv("UTF-8","gb2312", $zh); | ||
1740 | - @$s2 = iconv("gb2312","UTF-8", $s1); | 1739 | + @$s1 = iconv("UTF-8","gbk//ignore", $zh); |
1740 | + @$s2 = iconv("gbk//ignore","UTF-8", $s1); | ||
1741 | if($s2 == $zh){$zh = $s1;} | 1741 | if($s2 == $zh){$zh = $s1;} |
1742 | for($i = 0; $i < strlen($zh); $i++){ | 1742 | for($i = 0; $i < strlen($zh); $i++){ |
1743 | $s1 = substr($zh,$i,1); | 1743 | $s1 = substr($zh,$i,1); |
@@ -1763,8 +1763,8 @@ class HelperSearch | @@ -1763,8 +1763,8 @@ class HelperSearch | ||
1763 | if ($fchar >= ord("A") and $fchar <= ord("z") ) { | 1763 | if ($fchar >= ord("A") and $fchar <= ord("z") ) { |
1764 | return strtoupper($s0{0}); | 1764 | return strtoupper($s0{0}); |
1765 | } | 1765 | } |
1766 | - $s1 = @iconv("UTF-8","gb2312", $s0); | ||
1767 | - $s2 = @iconv("gb2312","UTF-8", $s1); | 1766 | + $s1 = @iconv("UTF-8","gbk//ignore", $s0); |
1767 | + $s2 = @iconv("gbk//ignore","UTF-8", $s1); | ||
1768 | if ($s2 == $s0) { | 1768 | if ($s2 == $s0) { |
1769 | $s = $s1; | 1769 | $s = $s1; |
1770 | } else { | 1770 | } else { |
-
Please register or login to post a comment