Commit e95d52f7 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 723944: Plain-text only emails are mangled when they contain non-ASCII characters

r=glob a=LpSolit
parent b670bf1d
...@@ -133,7 +133,11 @@ sub MessageToMTA { ...@@ -133,7 +133,11 @@ sub MessageToMTA {
my ($part) = @_; my ($part) = @_;
return if $part->parts > 1; # Top-level return if $part->parts > 1; # Top-level
my $content_type = $part->content_type || ''; 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; my $body = $part->body;
if (Bugzilla->params->{'utf8'}) { if (Bugzilla->params->{'utf8'}) {
$part->charset_set('UTF-8'); $part->charset_set('UTF-8');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment