X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FMIME.pm;h=afc077649939784e4cedf95a81d7b75efb04ded8;hb=refs%2Fheads%2Fdon%2Fprocesscleanup;hp=3719d2e23f304f6659a33825aab6a3051b873ffe;hpb=dd24067d306b8fb6c1984bcc77ccc374ba9bc9ec;p=debbugs.git diff --git a/Debbugs/MIME.pm b/Debbugs/MIME.pm index 3719d2e..afc0776 100644 --- a/Debbugs/MIME.pm +++ b/Debbugs/MIME.pm @@ -115,6 +115,9 @@ sub parse my @msg = split /\n/, $_[0]; my $i; + # assume us-ascii unless charset is set; probably bad, but we + # really shouldn't get to this point anyway + my $charset = 'us-ascii'; for ($i = 0; $i <= $#msg; ++$i) { $_ = $msg[$i]; last unless length; @@ -122,10 +125,12 @@ sub parse ++$i; $_ .= "\n" . $msg[$i]; } + if (/charset=\"([^\"]+)\"/) { + $charset = $1; + } push @headerlines, $_; } - - @bodylines = @msg[$i .. $#msg]; + @bodylines = map {convert_to_utf8($_,$charset)} @msg[$i .. $#msg]; } rmtree $tempdir, 0, 1;