Problems in displaying accents with htmlspecialchars

0
<?php echo htmlspecialchars ( $exibe_nome [ "nome" ] , ENT_QUOTES , 'UTF-8' ) ; ?>

Words that exist in my database with example (No) accent are not displayed in my echo if I remove the htmlspecialchars they appear.

How can I resolve this problem?

    
asked by anonymous 17.02.2015 / 05:29

1 answer

1

Well, I'm going to try to explain in parts, I think that's how to follow everything.

First check in the database the COLLATE that has and changes if it is not for utf8_unicode_ci and its data table.

In the database connection script you put this

header('Content-Type: text/html; charset=utf-8');
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');

And on the arrow page, the CHARSET you're on the user

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

I think that you do not have issues with accents, I've always done it like this and never had problems with encoding.

    
17.02.2015 / 15:05