How to set charset to UTF-8 in a Zend application?

前端 未结 9 1413
失恋的感觉
失恋的感觉 2021-01-05 14:29

I am developping a Zend application. The data in my database is encoded in \"utf8_unicode_ci\". I declared in my application.ini :

resources.view.encoding =          


        
9条回答
  •  花落未央
    2021-01-05 15:13

    Have you set the following, to fetch data from MySQL as utf8?

    resources.db.params.charset = "utf8"
    

    It is necessary to do three things to get correct characters displaying correctly:

    1. Save PHP/HTML files in utf8 encoding
    2. Fetch data from MySQL as utf8
    3. Send the right content-type / charset header or use a meta tag

    Further information in Rob Allen's article.

提交回复
热议问题