I'm getting this kind of result in my database ’
everytime i'm typing this character ’
I already use mysql_query('SET CHARACTER SET utf8');
when fetching data from my database.
I already have <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />.....
this one on my HTML.
What else is lacking here? Your help would be greatly appreciated and rewarded!
Thanks!
try to do a select with a charset collate and use utf8_bin like this:
if it works for you, you can change the collate for a column by using alter table, here is an example I used today for one of my dbs: (you could do this also with phpMyAdmin easily)
but make a backup first!
I notice that you're running this query...
mysql_query('SET CHARACTER SET utf8');
Try changing that to this...
That should ensure that the connection is UTF-8.
Also try going through the list of items on this article... http://blog.loftdigital.com/blog/php-utf-8-cheatsheet
This lists the steps that are needed to make sure you're using UTF-8 from front to back in your site/application but in summary:
mb_internal_encoding('UTF-8');
set in your script.mysql_query("SET NAMES 'utf8'");
which ensures the connection is UTF-8.header('Content-type: text/html; charset=UTF-8');
. This doesn't seem to be needed if you've setmb_internal_encoding()
above but useful for debugging<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />