ZF-3204: Mysqli dB adapter ignores utf8 connection charset

Issue Type: Bug Created: 2008-05-06T05:21:16.000+0000 Last Updated: 2008-06-09T17:25:43.000+0000 Status: Resolved Fix version(s): Reporter: Mihails Bogdanovs (mihabo) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Adapter_Mysqli

Related issues: - ZF-1541



I have used Zend_dB_Adapter_Mysqli to connect to a MySQL server 5.0.51a. All tables have uftf8 charset for their columns. UTF8 data entered in forms is saved correctly to the dB. When reading records from the database, only ascii characters were read normaly. It is also impossible (or I don't know how) to set the correct charset through adapter options. My workaround was to create my adapter as follows:

<pre class="highlight">
require_once 'Zend/Db/Adapter/Mysqli.php';

class MyMysqliDbAdapter extends Zend_Db_Adapter_Mysqli {
    protected function _connect() {
            if ($this->_connection) {
        $this->_connection -> set_charset('utf8');

This issue need at least to be documented. A good solution would be to add + document the corresponding option for the adapter.


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2021 by Zend by Perforce. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.