Merged localisation-work branch:
[lhc/web/wiklou.git] / languages / LanguageZh_cn.php
1 <?php
2 /**
3 * @package MediaWiki
4 * @subpackage Language
5 */
6 class LanguageZh_cn extends Language {
7 function stripForSearch( $string ) {
8 # MySQL fulltext index doesn't grok utf-8, so we
9 # need to fold cases and convert to hex
10 # we also separate characters as "words"
11 if( function_exists( 'mb_strtolower' ) ) {
12 return preg_replace(
13 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
14 "' U8' . bin2hex( \"$1\" )",
15 mb_strtolower( $string ) );
16 } else {
17 list( , $wikiLowerChars ) = Language::getCaseMaps();
18 return preg_replace(
19 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
20 "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
21 $string );
22 }
23 }
24 }
25
26
27 ?>