From 4c4deb5825137578cdbf512105ef918af754cbc0 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Thu, 22 Mar 2012 15:17:58 +0000 Subject: set default charset to php's default_charset if set --- it_dbi.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index 1303323..c85e2ed 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -33,7 +33,7 @@ class it_dbi 'pw' => "", 'safety' => 1, # 0= never die, 1=die if query invalid, 2=die also if no results #'keyfield' => 'ID', # Don't set to null here, filled later by _get_field_info() - 'charset' => null, # client charset (requires MySQL 5.0.7 or later) + #'charset' => # client charset (requires MySQL 5.0.7 or later) 'classprefix' => "", 'getfieldinfo' => true, # do not read schema. only select() allowed 'localized_defaultlanguage' => "de", # Localize fields with this suffix, e.g. copy title_de to title on read @@ -65,7 +65,7 @@ function it_dbi($p = array(), $query = null) $p += $dp; # Combine our settings with user's defaults and class defaults - $p += (array)$GLOBALS['it_dbi_defaultconfig'] + array('db' => $GLOBALS['ULTRADB']) + $this->_defaultconfig; + $p += (array)$GLOBALS['it_dbi_defaultconfig'] + array('db' => $GLOBALS['ULTRADB']) + $this->_defaultconfig + array('charset' => strtr(strtolower(ini_get('default_charset')), array('utf-8' => 'utf8'))); unset($this->_defaultconfig); # to shorten ED() output $this->_p = $p; -- cgit v1.2.3