2009/4/29 Octavian Rasnita <[email protected]> > 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? >
Try using the DSN method of enabling DBD::mysql attributes? I don't use Catalyst::Model::DBI, so this is just a guess, but try: __PACKAGE__->config( dsn => 'DBI:mysql:database=intranet;mysql_enable_utf8=1' ); -J
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
