aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dba/dba_pdo.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index 49f741601..2137ca0cc 100644
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -27,6 +27,13 @@ class dba_pdo extends dba_driver {
$dsn .= ';dbname=' . $db;
+ if ($this->driver_dbtype === 'mysql') {
+ $dsn .= ';charset=utf8mb4';
+ }
+ else {
+ $dsn .= ";options='--client_encoding=UTF8'";
+ }
+
try {
$this->db = new PDO($dsn,$user,$pass);
$this->db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);