Huangbin,

> I edit "msgs.subject" with phpMyAdmin directly, set a new value with
> Chinese characters, it works. But value inserted by Amavisd is still
> incorrect.

> mysql> SHOW VARIABLES LIKE 'character_set%';
> | 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       | /usr/share/mysql/charsets/

> Already have this lin my.cnf: 
> [client]
> default-character-set=utf8

Thanks, looks fine.

After experimenting a bit, it turns out the DBD::mysql module does
not observe the character_set_client setting, but needs an explicit
SET NAMES 'utf8', or mysql_enable_utf8 attribute.

Could you please try the following patch, it seems to solve
the problem at our site:

--- amavisd~    2009-06-25 14:39:01.000000000 +0200
+++ amavisd     2010-08-17 15:38:30.704067681 +0200
@@ -19410,4 +19410,5 @@
 # $dbh->{mysql_auto_reconnect} = 1;  # questionable benefit
 # $dbh->func(30000,'busy_timeout');  # milliseconds (SQLite)
+  $dbh->do("SET NAMES 'utf8'");
   section_time('sql-connect');
   $self;



Mark

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
AMaViS-user mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 Please visit http://www.ijs.si/software/amavisd/ regularly
 For administrativa requests please send email to rainer at openantivirus dot 
org

Reply via email to