UTF-8 encoding not working properly php
When I try to print a string from a DB the spanish accent is turned into ? .
Example de f?tbol, salones para actividades. ?Para m?s informaci?n I have tried following things
added <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Then I tried using utf8_encode() and utf8_decode() none of these things have worked.
I checked int he database the string is properly saved but when I print on the browser it is not printing properly.
Also in my Mysql DB I have mysql_set_charset('utf8',$dbSelect); added.
I think it is some kind of MySql error .
This is happening only when I do query using Join operation
SELECT xxxx1.tag,xxxx1.registro,xxxx1.valor FROM campofeed ". "INNER JOIN registrofeed ON xxx.id = xxxx1.registro ". "WHERE xxxx.feed='xxx' and xxxx.id='xxxxx'"
I had the same problem few months back.
What I did: go back and check that in the properties of your table you have set UTF8_regular or UTF8 or not. Most probably it must be in Latin.
Try setting the mysql_set_charset, i.e.:
$link = mysql_connect('localhost', 'user', 'password'); mysql_set_charset('utf8',$link); //the rest of the code...
Try this header in first line of php:
header('Content-type: text/html; charset=utf-8');