Now go start to work in Zend Framework 1:
You get a database “utf8_general_ci” collation.
In your config. Ini file add the following database settings:
; database information
resources.db.adapter = PDO_MYSQL
resources.db.params.host = localhost
resources.db.params.username = root
resources.db.params.password = root
resources.db.params.dbname = mydatabase
resources.db.isDefaultTableAdapter = true
resources.db.params.driver_options.1002 = “SET NAMES UTF8;”
The last line is very important, it ensures that your data is retrieved in UTF-8.
More info: http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html
SET NAMES indicates what character set the client will use to send SQL statements to the server. Thus, SET NAMES ‘cp1251′ tells the server, “future incoming messages from this client are in character set cp1251.” It also specifies the character set that the server should use for sending results back to the client. (For example, it indicates what character set to use for column values if you use a SELECT statement.)
In your header add next following meta tag:
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
Another little tip, when using Zend_Mail() remember:
$mail = new Zend_Mail(‘UTF-8′);
And now we can work without any problem using UTF-8 characters as in the French language.