Special and accented characters in mysql generates bad symbols in PHP -


my collation set utf8_general_ci both on tables , fields. html has meta tag changes charset utf8.

when use php framework, such codeigniter, or use following queries before selecting database, see no problem on pages

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

but i'm neither using kind of framework nor libraries, i'm working in company had project finished , noticed that, when save accented characters in database, example, "maçã" (apple in pt), seem stored fine mysql (at least when use phpmyadmin read table) displayed badly php/html. looks similar this:

ma< ?>< ?>

this known bad character question mark keeps coming everytime echo these words on code.

is there kind of configuration mysql or php solves problem (this specific one, i'm not talking general solution charset) once don't have keep correcting different functions , hacks?

i have realized utf8_encode on php side solves this. wanted kind of configuration appended config.php or sort of alter table. there out there?


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -