I'm migrating data from one database to another using PDO. Unfortunately, I need to set the charset to latin1 or else the French characters get messed up. I've done my research and apparently this is supposed to work:
$DBH = new PDO("mysql:host=$host;dbname=$dbname;charset=latin1", $user, $pass);
but unfortunately, it doesn't. I've also tried:
$DBH->exec("set names latin1");
as well as
$DBH->exec("SET NAMES 'latin1';
SET CHARACTER
SET latin1;");
after the initializing statement, but haven't found any luck. Any tips?