From facd49a195f77ed25fe5186a6455156e500beb80 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 8 Aug 2013 17:06:51 -0700 Subject: [PATCH] Specify quoting charset in PDO_MySQL --- adminer/drivers/mysql.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index cbba07e2..55d31df8 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -211,8 +211,8 @@ if (!defined("DRIVER")) { var $extension = "PDO_MySQL"; function connect($server, $username, $password) { - $this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password); - $this->query("SET NAMES utf8"); // charset in DSN is ignored + $this->dsn("mysql:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password); + $this->query("SET NAMES utf8"); // charset in DSN is ignored before PHP 5.3.6 return true; }