It can be one or both of these problems:
The output encoding is not set correctly. Put this in your .php file (at the top, before sending any output):
header("Content-Type: text/html; charset=UTF-8");
Your database connection / communication encoding (not quite sure what to call) is not set up correctly. Put this after you connect to the database, but before retrieving any data:
mysql_query('SET NAMES utf8'); // (or equivalent)
This ensures that communication between php and mysql is also done in utf8.
source share