From fe6b0728dea80e8ecddecdf75edb40de42dbf49a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 23 Oct 2004 10:53:17 +0000 Subject: [PATCH] fix for system with mbstring.func_overload set and NOT using utf-8 --- phpgwapi/inc/class.translation_sql.inc.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.translation_sql.inc.php b/phpgwapi/inc/class.translation_sql.inc.php index 19c1ef53bf..61f4983ae6 100644 --- a/phpgwapi/inc/class.translation_sql.inc.php +++ b/phpgwapi/inc/class.translation_sql.inc.php @@ -118,10 +118,20 @@ } if ($this->system_charset) // do we have a system-charset ==> return it { - return $this->system_charset; + $charset = $this->system_charset; } - // if no translations are loaded (system-startup) use a default, else lang('charset') - return !is_array(@$GLOBALS['lang']) ? 'iso-8859-1' : strtolower($this->translate('charset')); + else + { + // if no translations are loaded (system-startup) use a default, else lang('charset') + $charset = !is_array(@$GLOBALS['lang']) ? 'iso-8859-1' : strtolower($this->translate('charset')); + } + // we need to set our charset as mbstring.internal_encoding if mbstring.func_overlaod > 0 + // else we get problems for a charset is different from the default utf-8 + if (ini_get('mbstring.func_overload') && $this->mbstring_internal_encoding != $charset) + { + ini_set('mbstring.internal_encoding',$this->mbstring_internal_encoding = $charset); + } + return $charset; } function init()