[exim] UTF-8 characters and mysql lookups

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Tobias Dostal
Ημερομηνία:  
Προς: exim-users
Υ/ο: Tobias Dostal
Αντικείμενο: [exim] UTF-8 characters and mysql lookups
Hi there,

I was unable to get exim autoreply/vacation transport work with my mysql/utf8 tables so i had to do some research. I found these 2 old Mails:

http://www.gossamer-threads.com/lists/exim/users/86382

Arekm had the same Problem in 2009 and was able to fix it by using a SET NAMES utf8 query infront of every other.
I think thats a really ugly solution but it works.
Phil wrote then: it should work with the my.cnf entry "default-character-set=utf8" and Arekm said that it worked. - Problem solved.

But then - 2011 there was this Mail from Todd Lyons:
http://www.mail-archive.com/exim-users@exim.org/msg38835.html

He had also some Problems with the my.cnf defaults File and exim4..

"4. Our system already has default character set utf-8 in mysql on all
machines, so settings in my.cnf were already present and didn't solve
any issues for me."

With that option it would be an easy way to solve my issue.. but it didnt work for me either..

The Problem is:
libmysql doesn't use for all connections the defaults-file (my.cnf) - you have to specify it with mysql_options() before using mysql_real_connect()

http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html

exim source (4.80.1)

  mysql_handle = store_get(sizeof(MYSQL));
  mysql_init(mysql_handle);
  if (mysql_real_connect(mysql_handle,
      /*  host        user         passwd     database */
      CS sdata[0], CS sdata[2], CS sdata[3], CS sdata[1],
      port, CS socket, CLIENT_MULTI_RESULTS) == NULL)
    {


There is no mysql_option(), so libmysql ignores all default-files (both the system-default-file and the user file in his home)

Bad luck for me.. :)

It would be nice to support that in the next release?


Best Regards,
Tobias


Reference:
http://www.mail-archive.com/exim-users@exim.org/msg38835.html - http://www.mail-archive.com/exim-users@exim.org/msg38836.html
and
http://www.gossamer-threads.com/lists/exim/users/86382