[exim] correct way to set charset in mysql connections?

Top Page
Delete this message
Reply to this message
Author: Arkadiusz Miskiewicz
Date:  
To: exim-users
Subject: [exim] correct way to set charset in mysql connections?

Hi,

I have a lookup

text = "${lookup mysql{SELECT content FROM user WHERE login='${quote_mysql:
$local_part}'}}"

that fetches text message from database. Text message contains non ascii
characters.

Now with mysql >= 4.1 you need to specify charset in which you want to see
query output (mysql is able to do charset recoding on the fly).

Default is latin1, so if you have some non-latin1 data then output will return
"?" chars instead of non-latin1 characters.

"SET NAMES utf8" tells mysql to return utf8 output instead of default latin1
for example.

Now how can I issue charset in such queries?

${lookup mysql{SET NAMES utf8; SELECT ...

doesn't work.

-- 
Arkadiusz Miśkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/