how to realize i18N

I want display title in Chinese . I do as this,

<?php

// uncomment the following to define a path alias

// Yii::setPathOfAlias(‘local’,‘path/to/local-folder’);

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


[u]'name'=&gt;Yii::t('comm', 'title') ,[/u]

and I create a dir ch_zn ,then a comm.php like this,

<?php

return array(

'title'=&gt;'我的第一个应用',

);

why, my page still cannot display chinese characters?

help! help!

thanks in advance.

you need to set the application language to chinese in some way either in a controller or in the config file. (i think chinese is zh-CN n not zn-CH so u should probably use that, not that it really has an effect on the results, just for correctness(even a word?)).

mysql数据库用utf8编码

views文件也用utf8编码

数据库配置中加上,

‘db’=>array(

                    ...


                    'charset' =&gt; 'utf8',


            ),

这三者的编码一致就不会出现乱码了