]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Try to set utf8mb4 if possible
authorJakub Vrana <jakub@vrana.cz>
Tue, 10 Mar 2015 16:21:30 +0000 (09:21 -0700)
committerJakub Vrana <jakub@vrana.cz>
Tue, 10 Mar 2015 16:21:30 +0000 (09:21 -0700)
adminer/drivers/mysql.inc.php

index 661a18b0b14c75b627e9d2d10a7c703d8f24fd32..47f22a2ad1895f65721ea47308e86cee9fce2e43 100644 (file)
@@ -28,6 +28,9 @@ if (!defined("DRIVER")) {
                        }
 
                        function set_charset($charset) {
+                               if (parent::set_charset($charset)) {
+                                       return true;
+                               }
                                // the client library may not support utf8mb4
                                parent::set_charset('utf8');
                                return $this->query("SET NAMES $charset");
@@ -86,6 +89,9 @@ if (!defined("DRIVER")) {
                        */
                        function set_charset($charset) {
                                if (function_exists('mysql_set_charset')) {
+                                       if (mysql_set_charset($charset, $this->_link)) {
+                                               return true;
+                                       }
                                        // the client library may not support utf8mb4
                                        mysql_set_charset('utf8', $this->_link);
                                }