Charset koi8r
Charset koi8r
kagatan
Posts: 3Questions: 2Answers: 0
My database is charset=koi8r_general_ci . When outputting data (DataTables server-side ) to get a table "???"
Previously used the command
" mysql_set_charset('koi8r'); "
How to be now?
This discussion has been closed.
Answers
Found the solution! Need to change the code ssp.class.php :
array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) >>> to >>>>
array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
static function sql_connect ( $sql_details )
{
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)
//array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION )
);
}
catch (PDOException $e) {
SSP::fatal(
"An error occurred while connecting to the database. ".
"The error reported by the server was: ".$e->getMessage()
);
}