I am running MariaDB on CentOS 7 with PHP 5.6. Here is my connection string:
try {
$connStr = 'mysql:host=server;dbname=mysql';
$pdo = new PDO($connStr, 'user', 'passwd');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES utf8');
catch(PDOException $err) {
var_dump($err->getMessage());
die();
}
Everything works fine, there is no encoding issues except with PDO errors which raise some weirds characaters:
MUH��/NU(~�03��D!71G� ����J����̜��*���+S��+S��N|5
How can I manage that?