From 88451107aeb037f78ef63b6af66f4f23ec4a4dc1 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 27 Dec 2007 16:47:27 -0600 Subject: [PATCH] UTF8 and mysql: enable UTF8 mode correctly Doc for DBD::mysql states that if not setting mysql_enable_utf8 as part of the database connect(), must do it before doing "set names utf8" Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Context.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Context.pm b/C4/Context.pm index 49b7435faf..48bf9a6816 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -605,8 +605,8 @@ sub _new_dbh if ( $db_driver eq 'mysql' ) { # Koha 3.0 is utf-8, so force utf8 communication between mySQL and koha, whatever the mysql default config. # this is better than modifying my.cnf (and forcing all communications to be in utf8) - $dbh->do("set NAMES 'utf8'") if ($dbh); $dbh->{'mysql_enable_utf8'}=1; #enable + $dbh->do("set NAMES 'utf8'"); } elsif ( $db_driver eq 'Pg' ) { $dbh->do( "set client_encoding = 'UTF8';" );