}
function iconv( $in, $out, $string ) {
- # For most languages, this is a wrapper for iconv
- return iconv( $in, $out . '//IGNORE', $string );
+ # This is a wrapper for iconv in all languages except esperanto,
+ # which does some nasty x-conversions beforehand
+
+ # Even with //IGNORE iconv can whine about illegal characters in
+ # *input* string. We just ignore those too.
+ # REF: http://bugs.php.net/bug.php?id=37166
+ # REF: https://bugzilla.wikimedia.org/show_bug.cgi?id=16885
+ wfSuppressWarnings();
+ $text = iconv( $in, $out . '//IGNORE', $string );
+ wfRestoreWarnings();
+ return $text;
}
// callback functions for uc(), lc(), ucwords(), ucwordbreaks()
*/
class LanguageEo extends Language {
function iconv( $in, $out, $string ) {
- # For most languages, this is a wrapper for iconv
# Por multaj lingvoj, ĉi tiu nur voku la sisteman funkcion iconv()
# Ni ankaŭ konvertu X-sistemajn surogotajn
if( strcasecmp( $in, 'x' ) == 0 and strcasecmp( $out, 'utf-8' ) == 0) {
return preg_replace( '/((?:[cghjsu]|\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]'.
'|\xc5[\x9c\x9d\xac\xad])x*)/ei', 'strtr( "$1", $ux )', $string );
}
- return iconv( $in, $out, $string );
+ return parent::iconv( $in, $out, $string );
}
function checkTitleEncoding( $s ) {