Fix typo
[lhc/web/wiklou.git] / languages / LanguageRu.php
1 <?
2 # See language.doc
3 global $IP;
4 include_once("$IP/Utf8Case.php");
5
6 class LanguageRu extends LanguageUtf8 {
7 # Inherit everything
8
9 function checkTitleEncoding( $s ) {
10 global $wgInputEncoding;
11
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 );
16
17 if( $ishigh and !$isutf )
18 return iconv( "windows-1251", "utf-8", $s );
19
20 return $s;
21 }
22
23 }
24
25 ?>