PHP MySQL & UTF-8 Encoding
Trying to display chinese text in a PHP script from a MySQL DB, proved to be more tricky than i thought, using phpMyAdmin i was able to insert an edit chinese text in a db which has a ‘utf8_general_ci’ charset, but when i tried to show that text in a php page the only thing i’ve got was a long string of question marks.
Searching for a solution on the internet, i found this solution in a comment in php.net
mysql_query("SET CHARACTER SET 'utf8'", $conn);
Placing this just before the query did the trick!







