[CDBI] [Repost] Set utf8 character set on class connection?

[prev] [thread] [next] [Date index for 2006/01/08]

From: Birgit Kellner
Subject: [CDBI] [Repost] Set utf8 character set on class connection?
Date: 21:49 on 08 Jan 2006
Hello,

in November I posted a query to this list concerning utf8 problems with 
Class::DBI. Brian Philips was so nice as to help me on- and off-list, 
but we couldn't resolve the problem and I then had to devote my time to 
other issues, and let the matter rest for a while.

So here I go again:

The database uses utf8 encoding in MySQL 4.1.
With DBI, for some reason I have to execute "set names utf8" after 
setting up the database connection.
I have set all MySQL character variables to "utf8", but DBI doesn't seem 
to read them.

Rewriting the script for Class::DBI, I've now defined this class 
connection:
ILKB::DBI->connection("dbi:mysql:ilkb_test",'$usr','$pwd');

But how do I set the character set on this connection?
I was thinking of using "set_sql", but don't know the correct syntax.

Following Brian's advice, I tried several approaches that required 
modifying my.cnf and trying to get Class::DBI to read its parameters 
from there, but none of them worked. From the command-line, all database 
character variables are set to "utf8". Php scripts that run with the 
same MySQL installation have no problems with utf8 either. Hence I 
presume that it's to do with Perl, and with DBI, or Class::DBI in 
particular.

I sincerely hope that someone can help me, for otherwise I might have to 
drop Class::DBI (very reluctantly, as I really like it) and sadly revert 
to my hand-stitched relation-handling ...

Thank you very much,

Birgit Kellner

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

[CDBI] [Repost] Set utf8 character set on class connection?
Birgit Kellner 21:49 on 08 Jan 2006

Generated at 01:21 on 10 Jan 2006 by mariachi v0.52