PHP mysql charset utf8 problems
character-encoding, mysql, php, utf-8
Solution
Try this
<?php
header('Content-Type: text/html; charset=utf-8');
?>
and then in the connection
<?php
$dbLink = mysql_connect($argHost, $argUsername, $argPassword);
mysql_query("SET character_set_results=utf8", $dbLink);
mb_language('uni');
mb_internal_encoding('UTF-8');
mysql_select_db($argDB, $dbLink);
mysql_query("set names 'utf8'",$dbLink);
?>
Problem
Possible Duplicate: UTF-8 all the way through I'm developing some new features on a website that somebody else already developed. I'm having a problem the charset. I saw that the database had some tables in utf8 and some in latin1 So I'm trying to convert all the tables in UTF8. I did it for one table (also the fields of this table now are utf8), but was not successful. I'm using the normal mysql connect. I have to put any config to say that it must connect with utf8 to the DB? If yes witch one? In my html I have: ``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ``` It looks like some letters works and others display the question mark. For example it not able to display this ’ that is different of this: '