Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php6
-rw-r--r--libraries/classes/Charsets.php25
2 files changed, 29 insertions, 2 deletions
diff --git a/index.php b/index.php
index 2274e69122..ef2764769b 100644
--- a/index.php
+++ b/index.php
@@ -369,12 +369,14 @@ if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
echo ' <li id="li_select_mysql_charset">';
echo ' ' , __('Server charset:') , ' '
. ' <span lang="en" dir="ltr">';
- $unicode = Charsets::$mysql_charset_map['utf-8'];
+
+ $charset = Charsets::getServerCharset($GLOBALS['dbi']);
$charsets = Charsets::getMySQLCharsetsDescriptions(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['DisableIS']
);
- echo ' ' , $charsets[$unicode], ' (' . $unicode, ')';
+
+ echo ' ' , $charsets[$charset], ' (' . $charset, ')';
echo ' </span>'
. ' </li>'
. ' </ul>'
diff --git a/libraries/classes/Charsets.php b/libraries/classes/Charsets.php
index 4f73e0eed8..c01159271d 100644
--- a/libraries/classes/Charsets.php
+++ b/libraries/classes/Charsets.php
@@ -49,6 +49,14 @@ class Charsets
);
private static $_charsets = array();
+
+ /**
+ * The charset for the server
+ *
+ * @var string
+ */
+ private static $_charset_server;
+
private static $_charsets_descriptions = array();
private static $_collations = array();
private static $_default_collations = array();
@@ -127,6 +135,23 @@ class Charsets
}
}
+ /**
+ * Get current MySQL server charset.
+ *
+ * @param DatabaseInterface $dbi DatabaseInterface instance
+ *
+ * @return string
+ */
+ public static function getServerCharset(DatabaseInterface $dbi)
+ {
+ if (self::$_charset_server) {
+ return self::$_charset_server;
+ } else {
+ self::$_charset_server = $dbi->getVariable('character_set_server');
+ return self::$_charset_server;
+ }
+ }
+
/**
* Get MySQL charsets
*