If only the data coming from the database contains strange characters in it, make sure the MySQL connection is also in UTF8 using:
mysql_query("SET NAMES UTF8");
before any other requests. Otherwise, if characters also appear in handwritten files, make sure the files are saved as UTF-8 in your editor. You can also try customizing the charset header via PHP:
header('Content-type: text/html; charset=UTF-8');
Also make sure that all the fields in the programmed tables are specified as some UTF-8 variant, for example utf8_general_ci .
Tatu Ulmanen
source share