When I select it from the db using PDO as follows it becomes "325°F" how do I fix this. I can't set the charset in the header prior to this because I am doing an export so can't send any headers yet. I have set accept-charset="utf-8" on the submitted form though.
The collation on the column, table and db is utf8_general_ci
Code: Select all
$rdb = new PDO("$dbtype:host=$dbhost;dbname=$dbrecipes;charset=utf8", $dbuser, $dbpass);
$sql = "Call query_recipe(:id)";
$dbrecipe = $rdb->prepare($sql);
$dbrecipe->bindValue(':id', $id);
$dbrecipe->execute();
$err=$rdb->errorInfo();
$rsrecipe = $dbrecipe->fetch(PDO::FETCH_BOTH);
$dbrecipe->closeCursor();
$directions=$rsrecipe[1];