diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2012-02-16 18:32:19 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-02-16 18:32:19 +0100 |
commit | 4622fc071220abaf0defbbde7be6c0c9ecba8aa8 (patch) | |
tree | 09ede202d051745d7f4f016e271dee6f2d5aedfc | |
parent | e9ec8679a651682a64838f97a2cce87ddc6dbd0e (diff) | |
download | bugzilla-4622fc071220abaf0defbbde7be6c0c9ecba8aa8.tar.gz bugzilla-4622fc071220abaf0defbbde7be6c0c9ecba8aa8.tar.xz |
Bug 723944: Plain-text only emails are mangled when they contain non-ASCII characters
r=glob a=LpSolit
-rw-r--r-- | Bugzilla/Mailer.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 5ee6fd2eb..7e42cb609 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -91,7 +91,11 @@ sub MessageToMTA { my ($part) = @_; return if $part->parts > 1; # Top-level my $content_type = $part->content_type || ''; - if ($content_type !~ /;/) { + $content_type =~ /charset=['"](.+)['"]/; + # If no charset is defined or is the default us-ascii, + # then we encode the email to UTF-8 if Bugzilla has utf8 enabled. + # XXX - This is a hack to workaround bug 723944. + if (!$1 || $1 eq 'us-ascii') { my $body = $part->body; if (Bugzilla->params->{'utf8'}) { $part->charset_set('UTF-8'); |