Stubs for hebrew and arabic language files; support for 'dir=rtl' on html element
[lhc/web/wiklou.git] / languages / LanguageAr.php
1 <?
2 # See language.doc
3 include_once("Utf8Case.php");
4
5 class LanguageAr extends LanguageUtf8 {
6 # Inherit everything
7
8 # TODO: right-to-left support functions...?
9 function isRTL() { return true; }
10
11 # There may be a partial translation; get this merged in.
12
13 function checkTitleEncoding( $s ) {
14 global $wgInputEncoding;
15
16 # Check for non-UTF-8 URLs; assume they are windows-1256?
17 $ishigh = preg_match( '/[\x80-\xff]/', $s);
18 $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
19 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
20
21 if( $ishigh and !$isutf )
22 return iconv( "windows-1256", "utf-8", $s );
23
24 return $s;
25 }
26
27 }
28
29 ?>