mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
fix PHP 8.1 error/mysqli_sql_exception: Invalid character set was provided (utf-8 instead of utf8)
This commit is contained in:
parent
73662af7b2
commit
64c9507912
@ -227,9 +227,12 @@ class Egw extends Egw\Base
|
||||
// for the migration: reference us to the old phpgw object
|
||||
$GLOBALS['phpgw'] =& $this;
|
||||
|
||||
if ($GLOBALS['egw_info']['server']['system_charset'])
|
||||
{
|
||||
$this->db->Link_ID->SetCharSet($GLOBALS['egw_info']['server']['system_charset']);
|
||||
try {
|
||||
// set our default charset
|
||||
$this->db->Link_ID->SetCharSet($this->db->Type === 'mysql' ? 'utf8' : 'utf-8');
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
_egw_log_exception($e);
|
||||
}
|
||||
// restoring server timezone, to avoid warnings under php5.3
|
||||
if (!empty($GLOBALS['egw_info']['server']['server_timezone']))
|
||||
@ -621,4 +624,4 @@ class Egw extends Egw\Base
|
||||
$this->db->disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user