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');
//the rest of the code...

Try this header in first line of php:

header('Content-type: text/html; charset=utf-8');

Need Your Help

How do Asynchronous Procedure Calls handle marshaled delegates when you P/Invoke from C#?

c# .net multithreading winapi pinvoke

I am wondering if it is possible to fall victim to issues around the management of managed threads in the native world when you marshal a callback delegate to a DLL through P/Invoke in my particula...