From cdd182ce356b697d0c1d029c1f7fe64277d8410f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 11 Dec 2013 00:13:40 +0100 Subject: [PATCH] Send "SET NAMES utf8" to MySQL for PHP below 5.3.6 --- lib/private/db.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/db.php b/lib/private/db.php index 1e5d12649d..562065259f 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -101,6 +101,9 @@ class OC_DB { ); $connectionParams['adapter'] = '\OC\DB\Adapter'; $connectionParams['wrapperClass'] = 'OC\DB\Connection'; + // Send "SET NAMES utf8". Only required on PHP 5.3 below 5.3.6. + // See http://stackoverflow.com/questions/4361459/php-pdo-charset-set-names#4361485 + $eventManager->addEventSubscriber(new \Doctrine\DBAL\Event\Listeners\MysqlSessionInit); break; case 'pgsql': $connectionParams = array(