LanguageZh_hans.php 641 B

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