How is your connection made, Mysql Conect, Mysqli, PDO?
I think this would be the solution:
@mysql_query("SET NAME 'utf8'");
@mysql_query("SET character_set_connection=utf8");
@mysql_query("SET character_set_client=utf8");
@mysql_query("SET character_set_results=utf8");
PDO:
$db = new PDO("mysql:host=$dbHost;dbname=$dbName;charset=utf-8", $dbUser, $dbPass);
$db-> exec("SET CHARACTER SET utf8");
Mysqli:
$con=mysqli_connect("localhost","user","pass","db");
// Verifica conexão
if (mysqli_connect_errno())
{
echo "Falha ao fazer conexão: " . mysqli_connect_error();
}
// Set utf8
mysqli_set_charset($con,"utf8");
mysqli_close($con);
?>
CODIGNITER:
Please check if config.php and database.php are like this
config.php
'$config['charset'] = 'UTF-8'
database.php:
$db['default']['char_set'] = 'utf8';
and
$db['default']['dbcollat'] = 'utf8_general_ci';
UFT-8 IN AJAX REQUIREMENT:
.ajax({
async: false,
type: "GET",
url: url,
contentType: "charset=utf-8",
success: function(data)
{
$(".container").html(data);
}
});
HEADER:
header('Content-type: text/html; charset=utf-8');
Make sure that all your files are saved as UTF-8 (UTF-8 or w.o BOM). Configure formatting in your IDE.