00001 <?php 00002 00006 class LanguageZh_hans extends Language { 00007 function stripForSearch( $string ) { 00008 # MySQL fulltext index doesn't grok utf-8, so we 00009 # need to fold cases and convert to hex 00010 # we also separate characters as "words" 00011 if( function_exists( 'mb_strtolower' ) ) { 00012 return preg_replace( 00013 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", 00014 "' U8' . bin2hex( \"$1\" )", 00015 mb_strtolower( $string ) ); 00016 } else { 00017 list( , $wikiLowerChars ) = Language::getCaseMaps(); 00018 return preg_replace( 00019 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", 00020 "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )", 00021 $string ); 00022 } 00023 } 00024 }