STUB Hungarian language file
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 8 Jul 2003 10:10:05 +0000 (10:10 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 8 Jul 2003 10:10:05 +0000 (10:10 +0000)
languages/LanguageHu.php [new file with mode: 0644]

diff --git a/languages/LanguageHu.php b/languages/LanguageHu.php
new file mode 100644 (file)
index 0000000..6d907e9
--- /dev/null
@@ -0,0 +1,24 @@
+<?
+# See language.doc
+include_once("Utf8Case.php");
+
+class LanguageHu extends LanguageUtf8 {
+       # Inherit everything
+
+       function checkTitleEncoding( $s ) {
+               global $wgInputEncoding;
+               
+               # Check for non-UTF-8 URLs; assume they are 8859-2
+               $ishigh = preg_match( '/[\x80-\xff]/', $s);
+               $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
+                '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
+
+               if( $ishigh and !$isutf )
+                       return iconv( "iso8859-2", "utf-8", $s );
+               
+               return $s;
+       }
+
+}
+
+?>