Fixes for the edit help popup link:
[lhc/web/wiklou.git] / languages / LanguageUtf8.php
index 85efec3..4508691 100644 (file)
@@ -64,6 +64,13 @@ class LanguageUtf8 extends Language {
 
                return $this->iconv( $this->fallback8bitEncoding(), "utf-8", $s );
        }
+
+       function firstChar( $s ) {
+               preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
+               '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})/', $s, $matches);
+               
+               return isset( $matches[1] ) ? $matches[1] : "";
+       }
 }
 
 } # ifdef MEDIAWIKI