protected function setConnectionCharset()
{
if ($this->_charset === '' || $this->_active === false) {
return;
}
switch ($this->_pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) {
case 'mysql':
case 'sqlite':
$stmt = $this->_pdo->prepare('SET NAMES ?');
break;
case 'pgsql':
$stmt = $this->_pdo->prepare('SET client_encoding TO ?');
break;
default:
throw new TDbException('dbconnection_unsupported_driver_charset', $driver);
}
$stmt->execute(array($this->_charset));
}