diff options
author | 2007-11-23 12:58:33 +0000 | |
---|---|---|
committer | 2007-11-23 12:58:33 +0000 | |
commit | 9f0310bf8c0821347699b434f659eb52decabf87 (patch) | |
tree | 31153ecb72f2b57a9bb3daf638cc4e1152f8a0b0 /Bugzilla/Mailer.pm | |
parent | Bug 404412: Couldn't edit comments anymore because of a regression from bug ... (diff) | |
download | bugzilla-9f0310bf8c0821347699b434f659eb52decabf87.tar.gz bugzilla-9f0310bf8c0821347699b434f659eb52decabf87.tar.bz2 bugzilla-9f0310bf8c0821347699b434f659eb52decabf87.zip |
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 <mkanat@bugzilla.org> r=wurblzap, a=mkanat
Diffstat (limited to 'Bugzilla/Mailer.pm')
-rw-r--r-- | Bugzilla/Mailer.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 03f370a4e..48f40d8b7 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -67,7 +67,9 @@ sub MessageToMTA { # Encode the headers correctly in quoted-printable foreach my $header qw(From To Cc Reply-To Sender Errors-To Subject) { if (my $value = $email->header($header)) { - $value = Encode::decode("UTF-8", $value) if Bugzilla->params->{'utf8'}; + if (Bugzilla->params->{'utf8'} && !utf8::is_utf8($value)) { + $value = utf8::decode($value); + } my $encoded = encode('MIME-Q', $value); $email->header_set($header, $encoded); } |