DataTable : pb with data with accents !

Hello,

I use a datatable with url:‘data/index_data.php’

in my “index_data.php” file, i extract data from my mysql database (utf8).


$data = new JSONDataConnector($conn, $dbtype);

$sql .= “SELECT t2.value as dest
FROM ps_belvg_CA_customerattributes_customer t1
INNER JOIN ps_belvg_CA_customerattributes_customer t2 on t2.id_customer = t1.id_customer and t2.id_belvg_customerattributes = 3
WHERE t1.id_belvg_customerattributes = 1
AND t1.value = ‘10/02/2015’
GROUP BY t2.value”;

$data->render_sql($sql, “”, “dest”);

the field “dest” can have values with accents (french strings).

during the display of my datatable, all strings with accents are shown with ‘NULL’ value !

No problem with strings without accents.

All Javascript scripts used have charset=‘utf-8’.

Any ideas ?

thanks you in advance

Fabrice

Which encoding you have for data in the database ?

As far as I know, connector will not post process data in any way. So it can be a problem with DB encoding.

You can enable log for connector and check the exact code of SQL operations.

http://docs.dhtmlx.com/connector__php__errors.html#serversidelogging

Thanks you for your response but i found my problem.

My mysql database has a charset=‘utf-8’.

The problem was the encoding exchange between my database and php.

so this is the solution :

mysql_set_charset(‘utf8’, $conn);