[Catalyst] Using mysql_enable_utf8

Octavian Rasnita orasnita at gmail.com
Wed Apr 29 09:51:13 GMT 2009


Hi,

I need to use C::M::DBI for a fulltext index with MySQL, and the tables 
contain UTF-8 data.

I found that I can use mysql_enable_utf8 but I couldn't find how to use this 
option.

I've tried to use it in the model in 2 places as:

__PACKAGE__->config(
    dsn           => 'dbi:mysql:database=intranet',
    user          => 'root',
    password      => undef,
    options       => {
mysql_enable_utf8 => 1,
},
mysql_enable_utf8 => 1,
);

And I also tried to use it in the controller as

$dbh->{mysql_enable_utf8} = 1;

But with no success. The data still appears not encoded to UTF-8.

What am I doing wrong? Or do I need to make some other configurations?

---Octavian




More information about the Catalyst mailing list