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

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

From: Birgit Kellner
Subject: Re: [CDBI] [Repost] Set utf8 character set on class connection?
Date: 20:24 on 09 Jan 2006
Perrin Harkins wrote:

>
>
>If you switch to overriding db_Main and making the connection yourself,
>you can run the SQL to set the character set at connection time.  There
>are examples of overriding db_Main on the wiki.
>
>- Perrin
>
>
>  
>
Thanks to all who have replied thus far. Rose::DB looks good, but I have 
still a lot to learn in term of classes and subclasses in Perl, and I 
guess I'll stick with Class::DBI for the time being.

My script now begins with:

use Class::DBI;
package ILKB::DBI;
use base 'Class::DBI';
ILKB::DBI->connection("dbi:mysql:$db",'$usr','$pwd');
ILKB::DBI->db_Main->do("set names utf8");

I haven't tried inserts and updates yet, but retrieval of data now works 
fine and delivers wonderful utf8 characters! Hopefully inserts and 
updates work as well, though I don't see any reason why they shouldn't.

Thanks again,

best,

Birgit Kellner





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

(message missing)

Re: [CDBI] [Repost] Set utf8 character set on class connection?
Birgit Kellner 20:24 on 09 Jan 2006

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