]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - languages/classes/LanguageZh_hans.php
MediaWiki 1.15.4-scripts
[autoinstalls/mediawiki.git] / languages / classes / LanguageZh_hans.php
1 <?php
2
3 /**
4  * @ingroup Language
5  */
6 class LanguageZh_hans 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 }