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′”);

before

Zend_Db_Table::setDefaultAdapter($dbAdapter);

Bank of China

中国银行的网站终于改进了一下。以前外汇牌价网页在非中文平台上总显示乱码,现在用上了utf-8,这才有点像个”中国银行-全球门户网站”

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');

to

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

Then, UTF-8 encoding is successfully changed.

联通消失了

先跟我做个实验:如果你用的是中文windows,运行记事本,输入“联通”两个字不要带引号,任取文件名保存,再打开,你会发现联通消失了,留下一个小方块。

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

我不是第一个做这个实验的人,不过我跟开这个玩笑的人有着同样的感觉:联通确实不是个好名字,永远不能起头,所以永远被移动压着打。

如果非要联通起头后而不变成小方块,那么选择文档保存编码为非ANSI,可是大部分人不知道。

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确实好

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