From 67df38ddbfcd8522617a6ec2f8f1e0cf7b3295f7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 13 Nov 2015 12:47:17 +0000 Subject: [PATCH] set our default "utf-8" charset when opening db-connection, as some setup code, does not use egw-object and fail if php defaults to a different one --- phpgwapi/inc/class.egw.inc.php | 2 +- phpgwapi/inc/class.egw_db.inc.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index 5c84a0dad2..5a272010b6 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -127,7 +127,7 @@ class egw extends egw_minimal { $GLOBALS['egw_info']['server'][$row['config_name']] = $row['config_value']; } - if ($GLOBALS['egw_info']['server']['system_charset']) + if ($GLOBALS['egw_info']['server']['system_charset'] && $GLOBALS['egw_info']['server']['system_charset'] != 'utf-8') { $this->db->Link_ID->SetCharSet($GLOBALS['egw_info']['server']['system_charset']); } diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index 164e6c0df2..ea9e7c3d8f 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -548,6 +548,9 @@ class egw_db ini_set('mssql.textlimit',2147483647); ini_set('mssql.sizelimit',2147483647); } + // set our default charset + $this->Link_ID->SetCharSet('utf-8'); + $new_connection = true; } else