---------- 转发邮件信息 ----------
发件人:""chenlong85.2004" <chenlong85.2...@163.com>"
发送日期:2009-03-06 11:18:34
收件人:"Thomas Koch" <tho...@koch.ro>
主题: Re:[Components] Chinese code question
hi Thomas Koch ,thank you for your help! i only use PDO which connect mysql
encounter with the same problem that Chinese characters inserted
are garbled! so "$db = new PDO( $dsn,$admin,$pwd );
$db->exec("SET NAMES 'utf8';");" Chinese characters are ok! i check mysql that
mysql> SHOW VARIABLES LIKE 'character%';
+--------------------------+----------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | d:\AppServ\MySQL\share\charsets\ |
+--------------------------+----------------------------------+
8 rows in set (0.00 sec)
however,if there is not $db->exec("SET NAMES 'utf8';");",Chinese characters
inserted are garbled!
but if use database component, i don't konw how to set ("SET NAMES
'utf8';");", thanks for your help!
在2009-03-05,"Thomas Koch" <tho...@koch.ro> 写道:
>Hi,
>
>you could get better answers, if you'd provide more accurate descriptions of
>your problems.
>However I believe that your problem is not related to eZ Components, but to
>some unintended character set conversion somewhere on the way. Please read
>http://koch.ro/blog/index.php?/archives/50-MySQL-character-sets-primer.html
>and make sure, that mysql is configured the right way.
>
>Try to issue a
>set names utf8;
>statement at the beginning of your MySQL session.
>
>Best regards,
>
>Thomas Koch
>
>
>Am Thursday 05 March 2009 09:31:51 schrieb chenlong85.2004:
>> hi ,when i use database component, i find Chinese charactersinserted into
>> mysql are garbled. why ? who can help me !thank you !
>
>--
>Thomas Koch, http://www.koch.ro
>YMC AG, http://www.ymc.ch
>
>--
>Components mailing list
>Components@lists.ez.no
>http://lists.ez.no/mailman/listinfo/components
网易邮箱,中国第一大电子邮件服务商
--
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components