From 9f0310bf8c0821347699b434f659eb52decabf87 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 23 Nov 2007 12:58:33 +0000 Subject: Bug 363153: Turn on the utf8 bit on all strings in Bugzilla that contain non-ASCII data, if the utf8 parameter is on. This means that string functions like substr() work properly on multi-byte languages, now. Patch By Max Kanat-Alexander r=wurblzap, a=mkanat --- Bugzilla/DB/Mysql.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Bugzilla/DB/Mysql.pm') diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 25ee32b64..9e0d25277 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -58,8 +58,10 @@ sub new { my $dsn = "DBI:mysql:host=$host;database=$dbname"; $dsn .= ";port=$port" if $port; $dsn .= ";mysql_socket=$sock" if $sock; + + my $attrs = { mysql_enable_utf8 => Bugzilla->params->{'utf8'} }; - my $self = $class->db_new($dsn, $user, $pass); + my $self = $class->db_new($dsn, $user, $pass, $attrs); # This makes sure that if the tables are encoded as UTF-8, we # return their data correctly. -- cgit v1.2.3-24-g4f1b