Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 114034
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: rjbs [...] cpan.org
Cc: pali [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.87



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
On Štv Apr 28 07:34:23 2016, RJBS wrote: Show quoted text
> My suggestion: > * use FB_DEFAULT, not FB_PERLQQ in decoding mime headers > * treat utf8 in mime headers as utf-8-strict always
Make sense. I'm preparing patches for it. If you have any other suggestions for MIME-Header then let me know!
On Str Júl 13 18:17:10 2016, PALI wrote: Show quoted text
> On Štv Apr 28 07:34:23 2016, RJBS wrote:
> > My suggestion: > > * use FB_DEFAULT, not FB_PERLQQ in decoding mime headers > > * treat utf8 in mime headers as utf-8-strict always
> > Make sense. I'm preparing patches for it. > > If you have any other suggestions for MIME-Header then let me know!
Part of https://github.com/dankogai/p5-encode/pull/68 Released in Encode 2.87.