X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2Fclasses%2FLanguageEo.php;h=15fc8c037f5901f142fd709cd37b1f782133c2c8;hb=9074728fb9779b73bdfa851640c8e8b56b3fafaf;hp=6cddddbcfc7a38d32225457b76a17ba5c1edb903;hpb=4141e8831736ad4fca13b179179d7bc831033e49;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/classes/LanguageEo.php b/languages/classes/LanguageEo.php index 6cddddbcfc..15fc8c037f 100644 --- a/languages/classes/LanguageEo.php +++ b/languages/classes/LanguageEo.php @@ -54,9 +54,9 @@ class LanguageEo extends Language { * editor behavior; the original server-side translation system dates to 2002-2003 * when many browsers with really bad Unicode support were still in use. * - * @param string $in input character set - * @param string $out output character set - * @param string $string text to be converted + * @param string $in Input character set + * @param string $out Output character set + * @param string $string Text to be converted * @return string */ function iconv( $in, $out, $string ) { @@ -74,70 +74,46 @@ class LanguageEo extends Language { } /** - * @param $matches array + * @param array $matches * @return string */ function strrtuxCallback( $matches ) { static $ux = array( - 'x' => 'xx' , 'X' => 'Xx' , - "\xc4\x88" => "Cx" , "\xc4\x89" => "cx" , - "\xc4\x9c" => "Gx" , "\xc4\x9d" => "gx" , - "\xc4\xa4" => "Hx" , "\xc4\xa5" => "hx" , - "\xc4\xb4" => "Jx" , "\xc4\xb5" => "jx" , - "\xc5\x9c" => "Sx" , "\xc5\x9d" => "sx" , - "\xc5\xac" => "Ux" , "\xc5\xad" => "ux" + 'x' => 'xx', 'X' => 'Xx', + "\xc4\x88" => "Cx", "\xc4\x89" => "cx", + "\xc4\x9c" => "Gx", "\xc4\x9d" => "gx", + "\xc4\xa4" => "Hx", "\xc4\xa5" => "hx", + "\xc4\xb4" => "Jx", "\xc4\xb5" => "jx", + "\xc5\x9c" => "Sx", "\xc5\x9d" => "sx", + "\xc5\xac" => "Ux", "\xc5\xad" => "ux", ); return strtr( $matches[1], $ux ); } /** - * @param $matches array + * @param array $matches * @return string */ function strrtxuCallback( $matches ) { static $xu = array( - 'xx' => 'x' , 'xX' => 'x' , - 'Xx' => 'X' , 'XX' => 'X' , - "Cx" => "\xc4\x88" , "CX" => "\xc4\x88" , - "cx" => "\xc4\x89" , "cX" => "\xc4\x89" , - "Gx" => "\xc4\x9c" , "GX" => "\xc4\x9c" , - "gx" => "\xc4\x9d" , "gX" => "\xc4\x9d" , - "Hx" => "\xc4\xa4" , "HX" => "\xc4\xa4" , - "hx" => "\xc4\xa5" , "hX" => "\xc4\xa5" , - "Jx" => "\xc4\xb4" , "JX" => "\xc4\xb4" , - "jx" => "\xc4\xb5" , "jX" => "\xc4\xb5" , - "Sx" => "\xc5\x9c" , "SX" => "\xc5\x9c" , - "sx" => "\xc5\x9d" , "sX" => "\xc5\x9d" , - "Ux" => "\xc5\xac" , "UX" => "\xc5\xac" , - "ux" => "\xc5\xad" , "uX" => "\xc5\xad" + 'xx' => 'x', 'xX' => 'x', + 'Xx' => 'X', 'XX' => 'X', + "Cx" => "\xc4\x88", "CX" => "\xc4\x88", + "cx" => "\xc4\x89", "cX" => "\xc4\x89", + "Gx" => "\xc4\x9c", "GX" => "\xc4\x9c", + "gx" => "\xc4\x9d", "gX" => "\xc4\x9d", + "Hx" => "\xc4\xa4", "HX" => "\xc4\xa4", + "hx" => "\xc4\xa5", "hX" => "\xc4\xa5", + "Jx" => "\xc4\xb4", "JX" => "\xc4\xb4", + "jx" => "\xc4\xb5", "jX" => "\xc4\xb5", + "Sx" => "\xc5\x9c", "SX" => "\xc5\x9c", + "sx" => "\xc5\x9d", "sX" => "\xc5\x9d", + "Ux" => "\xc5\xac", "UX" => "\xc5\xac", + "ux" => "\xc5\xad", "uX" => "\xc5\xad", ); return strtr( $matches[1], $xu ) . strtr( $matches[2], $xu ); } - /** - * @param $s string - * @return string - */ - function checkTitleEncoding( $s ) { - # Check for X-system backwards-compatibility URLs - $ishigh = preg_match( '/[\x80-\xff]/', $s ); - $isutf = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . - '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ); - - if ( $ishigh and !$isutf ) { - # Assume Latin1 - $s = utf8_encode( $s ); - } else { - if ( preg_match( '/(\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]' . - '|\xc5[\x9c\x9d\xac\xad])/', $s ) ) - return $s; - } - - // if( preg_match( '/[cghjsu]x/i', $s ) ) - // return $this->iconv( 'x', 'utf-8', $s ); - return $s; - } - function initEncoding() { global $wgEditEncoding; $wgEditEncoding = 'x';