I know there are a lot of topics out there concerning this problem, but I've spend the last hours trying various approaches an I'm nowhere close to the solution. So here it goes ...
This is my jquery:
$.post('inc/app_json_f.php',{params:priv_params}, function (data) {
console.log(data);
// displays: \u00e2\u0082\u00ac instead of €
data = JSON.parse(data);
console.log(data);
// displays: â¬â¬ instead of €
}
This is my php (the app_json_f.php page):
$qry = 'select ... from ... where ...';
$data = $db->do_select($qry);
echo json_encode(f_utf8_json($data));
The f_utf8_json function will check the $data and convert every value with utf8_encode().
At this moment, the echo json_encode(...) will display the following in the console:
\u00e2\u0082\u00ac
Whereas I would like to see the € sign.
The data comes from a MySQL database which has collation utf8_general_ci. PHP's charset is UTF-8.
Any suggestions?