Browse Source

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 <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Galen Charlton 17 years ago
committed by Joshua Ferraro
parent
commit
88451107ae
  1. 2
      C4/Context.pm

2
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';" );

Loading…
Cancel
Save