summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config/Common.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-11-19 00:10:11 +0100
committermkanat%bugzilla.org <>2006-11-19 00:10:11 +0100
commit496a78f616b10c1c5c4bd0398021232e9bffa77e (patch)
treefd30d0e1fc1c7789111d43ef5d7ce7dd31baa7de /Bugzilla/Config/Common.pm
parentb8012210e03800d6473d2b19d7cf1beae6d12dc3 (diff)
downloadbugzilla-496a78f616b10c1c5c4bd0398021232e9bffa77e.tar.gz
bugzilla-496a78f616b10c1c5c4bd0398021232e9bffa77e.tar.xz
Bug 304550: Bugzilla should always store data in MySQL as UTF-8
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
Diffstat (limited to 'Bugzilla/Config/Common.pm')
-rw-r--r--Bugzilla/Config/Common.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 8b94220f8..a609936c0 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -48,7 +48,7 @@ use base qw(Exporter);
check_opsys check_shadowdb check_urlbase check_webdotbase
check_netmask check_user_verify_class check_image_converter
check_languages check_mail_delivery_method check_notification
- check_timezone
+ check_timezone check_utf8
);
# Checking functions for the various values
@@ -114,6 +114,18 @@ sub check_sslbase {
return "";
}
+sub check_utf8 {
+ my $utf8 = shift;
+ # You cannot turn off the UTF-8 parameter if you've already converted
+ # your tables to utf-8.
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->isa('Bugzilla::DB::Mysql') && $dbh->bz_db_is_utf8 && !$utf8) {
+ return "You cannot disable UTF-8 support, because your MySQL database"
+ . " is encoded in UTF-8";
+ }
+ return "";
+}
+
sub check_priority {
my ($value) = (@_);
my $legal_priorities = get_legal_field_values('priority');