Update memcached client to 1.0.10
[mediawiki.git] / languages / LanguageRu.php
blob4307a0212559ddd4f6b055d8b562fc8b6e00212a
1 <?
2 # See language.doc
3 global $IP;
4 include_once("$IP/Utf8Case.php");
6 class LanguageRu extends LanguageUtf8 {
7 # Inherit everything
9 function checkTitleEncoding( $s ) {
10 global $wgInputEncoding;
12 # Check for non-UTF-8 URLs; assume they are Windows-1251
13 $ishigh = preg_match( '/[\x80-\xff]/', $s);
14 $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
15 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
17 if( $ishigh and !$isutf )
18 return iconv( "windows-1251", "utf-8", $s );
20 return $s;