|
|||
|
I already change the default-character-set to UTF8 in my.cnf file.
However, Zend_Db didn't return the data as UTF8. How do I set the default-character-set to UTF8 in the ZF? I don't want to call the following function on every connection: $db->query('SET NAMES \'utf8\''); Any advice is greatly appreciated! |
|
|||
|
Hi,
You could create a class that inherits from Zend_Db and there you can execute. $db->query('SET NAMES utf8'); $db->query('SET CHARACTER SET utf8'); I my case the data are retrieved and saved correctly without supplying the character set. I don't know if something is broken yet ![]() The issue that I am having now is when I execute the following queries for Zend_Db_Adapter_Mysqli if ($db instanceof Zend_Db_Adapter_Mysqli || $db instanceof Zend_Db_Adapter_Pdo_Mysql) { $db->query('SET NAMES utf8'); $db->query('SET CHARACTER SET utf8'); } Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 50331646 bytes) in C:\www\websweet.ca\websweet\library\Zend-1.5.1\Zend\Db\Statement\Mysqli.php on line 227 Slavi |
![]() |
| Thread Tools | |
| Display Modes | |
|
|