Zhang Huangbin, > I try to store mail info in MySQL, and have @storage_sql_dsn set. > Seems Amavisd (2.6.4) inserts incorrect UTF-8 characters (Chinese) into > MySQL (msgs.subject). > > SQL used to create database: > > mysql> CREATE DATABASE amavisd DEFAULT CHARACTER SET utf8 COLLATE > utf8_general_ci; > > Then copy and source SQL commands from README.sql-mysql, try to send an > email with Chinese subject. In Thunderbird, subject in mail mime source is > "Subject: =?UTF-8?B?5Lit5paH5rWL6K+V?=". In Amavisd database > (msgs.subject) is "ä¸ æ–‡æµ‹è¯".
The msgs.subject string you show looks about right, assuming the cut/paste/wrapping problem in your =E4=B8 =E6=96=87=E6= =B5=8B=E8=AF. The actual UTF-8 encoded string resulting from =?UTF-8?B?5Lit5paH5rWL6K+V?= should be (in hex): e4 b8 ad e6 96 87 e6 b5 8b e8 af 95 Perhaps your MySQL client/server/results settings and resulting conversions are getting in the way. Try: SHOW VARIABLES LIKE 'character_set%'; You may try experimenting with client or server settings, perhaps: SET character_set_results = 'utf8'; or perhaps adding to my.cnf: [mysql] default-character-set=utf8 See also: http://dev.mysql.com/doc/refman/5.5/en/charset-connection.html 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 AMaViS-user@lists.sourceforge.net 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