From 52ad5282c8c4c367dafd9055e05f32d257387d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 31 Jul 2015 16:14:28 +0200 Subject: [PATCH] Use utf8mb4 to connect to the database. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if you use a mysql client and do "SET NAMES utf8mb4;" the pm and tag names should be correct now. Test this by creating a pm and or tag with unicode characters like ë, æ, ç or 😉 This will *NOT* correct previously created data. Convert this data before switching or you will get mojibake. --- phplib/Persistence.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phplib/Persistence.php b/phplib/Persistence.php index ab97342..8b8fff4 100644 --- a/phplib/Persistence.php +++ b/phplib/Persistence.php @@ -440,7 +440,7 @@ static function get_database_object() { $user = $config['database']['username']; $pass = $config['database']['password']; try { - $conn = new PDO('mysql:host='.$host.';port='.$port.';dbname='.$adb, $user, $pass); + $conn = new PDO('mysql:host='.$host.';port='.$port.';dbname='.$adb.';charset=utf8mb4', $user, $pass); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return $conn; } catch(PDOException $e) {