[转] Zend Framework 1.0.0RC2 Oracle UTF8 乱码问题解决办法

转载自: http://blog.csdn.net/phphot/article/details/1955164

 

这应该是 ZF 的 bug. 大部分人还是在用 OCI 吧 :P
  ZF 的 Issue Tracker 在这里:
  http://framework.zend.com/issues/browse/ZF-1541

  问题描述:
    1.Oracle DB nls_lang = american_america.utf8
    2.PHP 程式代码也是 utf-8 encode
    3.html 的meta 中 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />也是 utf8
    4. 调用 Zend_Db:Factory('oracle',array('username'=>'xx','password'=>'xx','dbname'=>'xx'))

    以上设置均是 utf8 编码,可是挑出来的资料内容有中文的话变成乱码了 :(

  解决办法:
    换成用 Pdo_Oci 的adapter, 具体原因参见 http://framework.zend.com/issues/browse/ZF-1541
    1. 启用 Oracle PDO Driver pdo_oci.dll (在 php.ini 中启用,同启用其它module [注: windows 下])
    2. 加上 charset = utf8 (Not utf-8)
    3. 调用时像这样 Zend_Db:Factory('oracle',array('username'=>'xx','password'=>'xx','dbname'=>'xx','charset'=>'utf8'))

 

相关文章:

http://framework.zend.com/issues/browse/ZF-1541

posted on 2012-06-28 01:24  DavidYanXW  阅读(401)  评论(0编辑  收藏  举报