I'm using database made for utf8_general_ci, tables are also utf8_general_ci and everything what can mess up with encoding is set to utf8_general_ci.
My connect string for PDO looks like this:
try {
$new = new PDO('mysql:host=' . $config['host'] . ';dbname=' . $config['database'] . ';charset=utf8', $config['username'], $config['password'], array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"));
$new->exec('SET NAMES utf8');
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
Unfortunately after select from database my encoding gets messed up. Can anyone tell me what am I doing wrong?