diff options
author | Ser5 <ser5lexx@gmail.com> | 2015-07-16 01:40:40 +0500 |
---|---|---|
committer | Ser5 <ser5lexx@gmail.com> | 2015-07-16 01:40:40 +0500 |
commit | 3d4af309a0f4228aa757913b2a42189401f728cc (patch) | |
tree | 302b6e62eaaa3bf2c5ab5664924b0c78fb28d918 | |
parent | 21b7f39e87fd6b46b97892db145aba0c5072f9b7 (diff) | |
download | gatekeeper-3d4af309a0f4228aa757913b2a42189401f728cc.zip gatekeeper-3d4af309a0f4228aa757913b2a42189401f728cc.tar.gz gatekeeper-3d4af309a0f4228aa757913b2a42189401f728cc.tar.bz2 |
Added "charset=utf8" to PDO initialization
This way non-latin characters are stored in database as is and not as garbage.
-rw-r--r-- | src/Psecio/Gatekeeper/DataSource/Mysql.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Psecio/Gatekeeper/DataSource/Mysql.php b/src/Psecio/Gatekeeper/DataSource/Mysql.php index 22d0622..5a1403a 100644 --- a/src/Psecio/Gatekeeper/DataSource/Mysql.php +++ b/src/Psecio/Gatekeeper/DataSource/Mysql.php @@ -32,7 +32,7 @@ class Mysql extends \Psecio\Gatekeeper\DataSource public function buildPdo(array $config) { return new \PDO( - 'mysql:dbname='.$config['name'].';host='.$config['host'], + 'mysql:dbname='.$config['name'].';host='.$config['host'].';charset=utf8', $config['username'], $config['password'] ); } @@ -295,4 +295,4 @@ class Mysql extends \Psecio\Gatekeeper\DataSource { return $this->lastError; } -}
\ No newline at end of file +} |