Permalink
Browse files

Fetch encoding once

  • Loading branch information...
1 parent fecb3c1 commit 9a1ba6861837e46dc2e0a1dcba7a50965e705963 @nijel nijel committed Apr 27, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 libraries/database_interface.lib.php
@@ -221,38 +221,40 @@ function PMA_DBI_convert_message($message)
}
if (! empty($server_language) && isset($encodings[$server_language])) {
+ $encoding = $encodings[$server_language];
+
if (function_exists('iconv')) {
if ((@stristr(PHP_OS, 'AIX'))
&& (@strcasecmp(ICONV_IMPL, 'unknown') == 0)
&& (@strcasecmp(ICONV_VERSION, 'unknown') == 0)
) {
include_once './libraries/iconv_wrapper.lib.php';
$message = PMA_aix_iconv_wrapper(
- $encodings[$server_language],
+ $encoding,
'utf-8' . $GLOBALS['cfg']['IconvExtraParams'],
$message
);
} else {
$message = iconv(
- $encodings[$server_language],
+ $encoding,
'utf-8' . $GLOBALS['cfg']['IconvExtraParams'],
$message
);
}
} elseif (function_exists('recode_string')) {
$message = recode_string(
- $encodings[$server_language] . '..' . 'utf-8',
+ $encoding . '..' . 'utf-8',
$message
);
} elseif (function_exists('libiconv')) {
- $message = libiconv($encodings[$server_language], 'utf-8', $message);
+ $message = libiconv($encoding, 'utf-8', $message);
} elseif (function_exists('mb_convert_encoding')) {
// do not try unsupported charsets
if (! in_array($server_language, array('ukrainian', 'greek', 'serbian'))) {
$message = mb_convert_encoding(
$message,
'utf-8',
- $encodings[$server_language]
+ $encoding
);
}
}

0 comments on commit 9a1ba68

Please sign in to comment.