From b55619a76c3a93e8ce7714e948afb8df74512dda Mon Sep 17 00:00:00 2001 From: Thomas BrĂ¼derli Date: Wed, 21 Apr 2010 12:27:27 +0000 Subject: Fix disabling of the syntax converter; allow to specify the db connection charset in it_dbi --- it_dbi.class | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index 9daf2c3..9ccfd48 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -33,6 +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) 'classprefix' => "", 'getfieldinfo' => true, # do not read schema. only select() allowed ); @@ -219,6 +220,10 @@ function _connect($p = array()) if (!(@mysql_select_db($p['db'], $this->_link))) $this->_fatal("_connect(): can't select database \"{$p['db']}\""); + + # set charset used for this connection + if ($p['charset']) + mysql_set_charset($p['charset'], $this->_link); $state['link'] = $this->_link; it_dbi::_state_put($dbid, $state, false); # Store only locally as link is not shared anyway -- cgit v1.2.3