15
Today I migrated my site to hostgator and happened this problem, the accents are all with some characters
The files are all with correct accent in the database
My collation in the database is as: utf8_general_ci
I’m using the goal: utf-8
I’ll put my SELECT to see if you find any problem:
<?php
$sql = mysql_query ("SELECT * FROM recadao ORDER BY id DESC LIMIT 3");
while ($exibe = mysql_fetch_assoc($sql)){
?>
<?php echo $exibe['recadao_mensagem']; ?>
<?php } ?>
I’ve been to over 500 places and I couldn’t solve the problem.
I’m in the same trouble right now!
– Lucas C.S
How you migrated the data?
– Cahe
I backed up the database, created a new database and inserted sql
– Josimara
@Josimara Tenta
echo utf8_encode($exibe['recadao_mensagem']);
– Lucas Henrique
That solved it, but why did this happen?
– Josimara
@Josimara Which IDE do you use? Should not be set to default UTF-8.
– Lucas Henrique
@Josimara put as an answer to your question.
– Lucas Henrique