[Dbix-class] Unicode conversion problems

Matias E. Fernandez pisco at gmx.ch
Tue Jul 6 10:08:36 GMT 2010


Hi Piotr

> check mysql server [...] client connection charset. if not ,set all to utf8.

True, but note that changing whatsoever configuration on the database 
side won't help unless you set mysql_enable_utf8 to a true value when 
calling 'connect()' on the Perl side. DBD::mysql will set the client 
connection to 'latin1' otherwise.

You can check dbdimp.c at lines 1760 ff. to see how it's done.

Another helpful hint is to create new schemas like this:

CREATE SCHEMA IF NOT EXISTS `my_new_db` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;

With that you don't need to be explicit about the character set 
when adding new tables (or columns) to that schema.

Regards
Matias E. Fernandez


More information about the DBIx-Class mailing list