[Solar-talk] UTF-8

Rodrigo Moraes rodrigo.moraes at gmail.com
Thu Jul 20 10:04:30 PDT 2006


Working with Solar_Sql and UTF-8 tables: I've added the method
_connect() to Solar_Sql_Adapter_Mysql:

    protected function _connect()
    {
        parent::_connect();
        if(isset($this->_config['charset'])) {
            $this->_pdo->exec('SET CHARACTER SET ' . $this->_config['charset']);
        }
    }

And a charset definition in config.php:

$config['Solar_Sql'] = array(
    'adapter' => 'Solar_Sql_Adapter_Mysql',
    'config'  => array(
        ...
        'charset' => 'utf8',
    )
);

Works perfectly. :-)

rodrigo moraes / brazil


More information about the solar-talk mailing list