I know this aurgement was discussed several times but no one solutions or workarounds works for me :(
I'm using a pdo driver to querying a db on my server. This is the connection:
new PDO('mysql:host=localhost;dbname=*******',
'****', '*****', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
The option PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8
Already solves a lot of problems before, and I've found it as possible solution as string's econding problems.
But my output is still "dirty" and the operation of json_encode()
(next operation to will after the data extraction) over some strings data fail without any chance to fix it, even with some extra options don't solve the problem!
The problem is from how the data are extracted from the db, even a var_Dump()
of all the data fetched show how strings are corrupeted, this is an example of a field printed by a var_dump of the query result:
Zup2 Zuppa È composta da diverse qualità di pesce, spesso quello cosiddetto "povero"
How can I solve this issue?