[Dbix-class] DBIC, MySQL and UTF8

Peter Edwards peter at dragonstaff.co.uk
Sun Jul 3 11:31:09 GMT 2011


On 3 July 2011 12:02, Dave Cross <dave at dave.org.uk> wrote:

>
> I have a MySQL db where all the tables contain UTF8 data. Actually, as far
> as I can see, the only problematic character is the =A3 sign.
>
> My DBIC connect looks like this:
>
> my $sch =3D MyData::DB->connect(
>  'dbi:mysql:database=3Dmydata;',
>  'user', 'xxxx', { mysql_enable_utf8 =3D> 1 }
> );
>
> Looking at
https://github.com/dbsrgits/dbix-class/blob/master/lib/DBIx/Class/Storage/D=
BI/mysql.pm

it doesn't look like it does a SET NAMES utf8; on initial connection and
you're not using an on_connect_do to set it so unless your mysql db conf is
set to default you might get issues?
Maybe worth using strict mode too :-\

Regards, Peter
http://perl.dragonstaff.co.uk



http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110703/6ac=
f12a7/attachment.htm


More information about the DBIx-Class mailing list