For anyone using PDO, the solution is similar to ntd's answer.
From the PHP PDO::__construct page, as a comment from the user Kiipa at live dot com:
To get UTF-8 charset you can specify that in the DSN.
$link = new PDO("mysql:host=localhost;dbname=DB;charset=UTF8");