Datatables Server-Side processing UTF-8

Datatables Server-Side processing UTF-8

sonnypsonnyp Posts: 3Questions: 2Answers: 0
edited May 2015 in Free community support

Hi,

I*m trying to use the server side processing, but I can't get any value with german Umlaute.
The DB is UTF-8, the Table is also UTF-8 and every Column too.
My PHP-Files are saved as UTF-8 without BOM.

Could you help me to find the problem?

http://jsfiddle.net/7w6ucdxb/

I tried to get the json response charset and I get ASCII :-(

$string= json_encode(utf8_encode(
SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ))
);
echo "ENCODING: " . mb_detect_encoding($string) . "\n";

Answers

  • sonnypsonnyp Posts: 3Questions: 2Answers: 0

    Okay problem solved.
    Thread can be closed.

    I changed the try container of the static function sql_connect:

    try { $db = @new PDO( "mysql:host={$sql_details['host']};dbname={$sql_details['db']}", $sql_details['user'], $sql_details['pass'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION) ); $db->exec("set names utf8"); $db->exec("set character_set_client='utf8'"); $db->exec("set character_set_results='utf8'"); $db->exec("set collation_connection='utf8_bin'"); }

This discussion has been closed.