Zend_Db ignore default charset of Mysql

While I set my Mysql database default character set as UTF-8, Zend_Db_Adapter does not pick up the setting. Zend_Db write to Mysql using its own default character set (I guess it’s ISO-8859-1), unless it is specifically told by

$dbAdapter->query(“SET NAMES ‘utf8′”);



Bank of China


Where to Set $xoops_charset

I prefer UTF-8, always.

I am sorry to see Xoops new release is by default still ISO-8859-1 encoded. Unfortunately, Xoops have not provided a complete reference book for all smarty tags. I struggled to change the charset.

First, I looked at theme.html, and found it is

<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />

instread of

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

Although I could erase “<{$xoops_charset}>” and put in “UTF-8”, I knew it was not the best way to change the default encoding.

So I began to search for where the smarty tag $xoops_charset is saved. I thought Xoops the adminstration interface had a place to change the charset. I went through each field in Site Preferences and found nowhere to set the charset.

It becomes a guess work for me where which value was stored. I searched the database but I could not find any value is “ISO-8859-1”.

Last method I used was a global search for the string “ISO-8859-1” in all Xoops source files. 16 hits. “/language/english/global.php” was likely to affect $xoops_charset. I opened it and changed a line from

define('_CHARSET', 'UTF-8');


define('_CHARSET', 'UTF-8');

Then, UTF-8 encoding is successfully changed.



拿这个例子来解释utf-8真是形象生动——因为记事本保存一份新建文档时的默认编码为ANSI,中文windows下就是GB2312,“联通”按GB2312保存为4个字节,头三个字节凑巧为utf-8编码文档开头的特征码byte order mark(BOM),所以记事本再次打开这个文件时,认定该文档是经utf-8编码,于是直接显示了第4个字节,那就是个小方块。



WP Shopping Cart Not Support utf-8

Recommended by WordPress, I installed one of business blogging plugin – WP Shopping Cart. Although I don’t think it’s a good idea to sell anything on this blog, I wanna try the plugin by categorising under WP Shopping Cart my investigation to hundred brands in Bicester Village.

To my disappointment, this plugin (ver 3.6 beta 7) does not support utf-8. I have to leave the plugin there. I don’t wanna do modification to this plugin by myself.


我是一个很懒的人,thunderbird出名已经很久了,我仍然stick to outlook or outlook express。本来也是,不就收发一下邮件嘛,用哪个软件有很大区别吗?今天由于其他方面的原因,我不得不下载thunderbird用了一下,当然它没有惊天动地打动我的地方,但它的utf8已经走到microsoft前面了,outlook/express在英文windows下总是处理不好中文主题或发件人(outlook处理不好中文发件人,而outlook express处理不好中文主题)。别看平时我也能忍受着阅读??????布满问号的邮件,但既然看到thunderbird做得这么好,那我决定更多地支持一下开源产品啦。