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'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
[u]'name'=>Yii::t('comm', 'title') ,[/u]
…
and I create a dir ch_zn ,then a comm.php like this,
<?php
return array(
'title'=>'我的第一个应用',
);
why, my page still cannot display chinese characters?
help! help!
thanks in advance.
jayrulez
(Waprave)
September 21, 2009, 2:30pm
2
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'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
[u]'name'=>Yii::t('comm', 'title') ,[/u]
…
and I create a dir ch_zn ,then a comm.php like this,
<?php
return array(
'title'=>'我的第一个应用',
);
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?)).
hreriam
(Likehere2008)
September 22, 2009, 8:13am
3
jayrulez:
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' => 'utf8',
),
这三者的编码一致就不会出现乱码了