0
In Coon.php that serves as a connection to my database, if I add this code:
mysql_query("SET NAMES 'utf8'");
mysql_query('SET character_set_connection=utf8');
mysql_query('SET character_set_client=utf8');
mysql_query('SET character_set_results=utf8');
the name is as in the image below:
If I take it, it looks like this.. Using this in the database is "Braganã§Ã£o" instead of "Braganção" and the problem is, when I will carry more things via json/ajax etc... it will take "Braganã§Ã" and not "braganção"
goal: make the name stay utf8 both on the page both in the database to always pull the correct name
On the page is the goal with utf-8
– rray
@rray yes both this <meta charset="utf-8"> both <meta http-equiv="content-type" content="text/html;charset=utf-8" />
– kaiquemix
Your file was saved as utf-without GOOD? Can guarantee the recorded data are with the right?
– rray
@rray utf-without?? , the structure in phpadmin is in utf8_general_ci
– kaiquemix
When I pull from the database it does that $sql = "ALTER DATABASE portfolio CHARSET = UTF8 COLLATE = utf8_general_ci";
– kaiquemix
php file, see in Notepad++ if it est[a as utf-8 without good
– rray
@rray as I see it explains me doing the favor ;)
– kaiquemix
Click on the enconding menu that already appears or at the bottom right corner
– rray
@rray is in UTF8 - (NO GOOD)
– kaiquemix
@rray in which Meeting I place?
– kaiquemix
That’s right.
– rray
@rray and now :( ???
– kaiquemix
Fractionates the project into parts to find the problem. Create a new file, clean and with correct charset, make the connection and have the data printed with echo. At the beginning of the php file set: header('Content-Type: text/html; charset=utf-8'); post the result.
– Clayderson Ferreira
Put the code snippet that shows the above characters, apparently you are doing double conversion.
– Bacco
This question Doubt with charset=iso-8859-1 and utf8 is different, but the answer there explains how to solve the problem step-by-step.
– Guilherme Nascimento