Problem reading database words with accent or cedilla

4

I'm reading my table database categories and when I have words with cedilla or accents, they appear in my project with strange characters.

For example, in the categories I have a Ratings title, in my project this title appears as: AVALIA��ES .

I was searching about this problem and realized that I had to have my Collation as utf8_general_ci , and also that at the top of my page should contain this goal: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

However, even with these 2 methods to solve the problem, I still have my title as AVALIA��ES .

Does anyone know what might be happening and how can I resolve this?

    
asked by anonymous 07.06.2014 / 20:58

1 answer

6

I propose that you do the following:

1 - Insert these lines of code into your database connection file:

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');

2 - Make sure the database is in UTF-8 format. To do this go to your database and go to Operations (phpmyadmin) and make sure your bank is storing the information with the correct encoding.

After that it is resolved.

    
07.06.2014 / 21:29