-<?
-$wgInputEncoding = "utf-8";
-$wgOutputEncoding = "utf-8";
-
-# Simple 1:1 upper/lowercase switching arrays for utf-8 text
-# Won't get context-sensitive things yet
-
-# Hack for bugs in ucfirst() and company
+<?php
+/**
+ * Simple 1:1 upper/lowercase switching arrays for utf-8 text
+ * Won't get context-sensitive things yet
+ *
+ * Hack for bugs in ucfirst() and company
+ *
+ * These are pulled from memcached if possible, as this is faster than filling
+ * up a big array manually. See also languages/LanguageUtf8.php
+ * @package MediaWiki
+ */
+/*
+ * Translation array to get upper case character
+ */
$wikiUpperChars = array(
"a" => "A",
"b" => "B",
"\xf0\x90\x91\x8d" => "\xf0\x90\x90\xa5"
);
+/*
+ * Translation array to get lower case character
+ */
$wikiLowerChars = array (
"A" => "a",
"B" => "b",
"\xf0\x90\x90\xa5" => "\xf0\x90\x91\x8d"
);
-# Base stuff useful to all UTF-8 based language files
-class LanguageUtf8 extends Language {
-
- function ucfirst( $string ) {
- # For most languages, this is a wrapper for ucfirst()
- # But that doesn't work right in a UTF-8 locale
- global $wikiUpperChars, $wikiLowerChars;
- return preg_replace (
- "/^([\\x00-\\x7f]|[\\xc0-\\xff][\\x80-\\xbf]*)/e",
- "strtr ( \"\$1\" , \$wikiUpperChars )",
- $string );
- }
-
- function stripForSearch( $string ) {
- # MySQL fulltext index doesn't grok utf-8, so we
- # need to fold cases and convert to hex
- global $wikiLowerChars;
- return preg_replace(
- "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
- "'U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
- $string );
- }
-}
-
-?>
\ No newline at end of file
+?>