Subject: | MIME header decoding using PERLQQ instead of replacement chars |
This was discovered by ROBM:
perl -E 'use Encode; my $x = decode("MIME-Header", "=?utf-8?Q?=f9=80=80=80=80?="); say $x; say length $x'
\x{1000000}
11
The fallback behavior is changed from FB_DEFAULT to FB_PERLQQ. This seems pretty bizarre. If decoding email to present to a user, you'd want to present a replacement character, not Perl code! Also, there's no way to override that argument.
On a related note, the code allows =?utf8?q?...?= to be decoded with lax UTF-8, rather than treating utf8 in mail headers as a synonym for utf-8-strict.
My suggestion:
* use FB_DEFAULT, not FB_PERLQQ in decoding mime headers
* treat utf8 in mime headers as utf-8-strict always
--
rjbs