Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

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

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

Bug Information
Severity: Critical
Broken in:
  • 2.42
  • 2.43
Fixed in: 2.83



MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1533
Download (untitled) / with headers
text/plain 1.4k
When encode() is called to encode a mail header using "MIME-Q", it breaks the header at apostrophes or colons resulting in extra whitespace when the header is unfolded by the MUA. Example code: #! /usr/local/bin/perl use strict; use Encode qw(encode); print "Encode version $Encode::VERSION\n"; print encode('MIME-Q',"Subject: Bla Blahbla blah:Blahbl & Blahbla Bla Blah Bla Can't Blahb Blahbla Bla. blah blah blah"),"\n"; print encode('MIME-Q',"Subject: Bla Blahbla blah:Blahbl & Blahbla Bla Blah Bla Cant Blahb Blahbla Bla. blah blah blah"),"\n"; print encode('MIME-Q',"Subject: Bla Blahbla blah Blahbl & Blahbla Bla Blah Bla Cant Blahb Blahbla Bla. blah blah blah"),"\n"; The output of the first line splits the word "Can't" at the apostrophe, and the second one it splits after "blah:". In both cases when the MUA unfolds the lines, the extra whitespace induced is retained, and the message headers, in this case the Subject, do not match the original intent. The space after the ":" could be ignored, but the one in the middle of the contraction "Can't" is totally wrong. This seems related to the tickets: 40027, 63387, and 67569 Here's the output I see with Perl 5.10 and 5.12 on FreeBSD 8.2: Encode version 2.43 Subject: Bla Blahbla blah:Blahbl & Blahbla Bla Blah Bla Can' t Blahb Blahbla Bla. blah blah blah Subject: Bla Blahbla blah: Blahbl & Blahbla Bla Blah Bla Cant Blahb Blahbla Bla. blah blah blah Subject: Bla Blahbla blah Blahbl & Blahbla Bla Blah Bla Cant Blahb Blahbla Bla. blah blah blah
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2602-1319249930-328.69535-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 202
Download (untitled) / with headers
text/plain 202b
I agree with this report. Line folding should only occur at whitespace. I'd prefer if there was a mime header encoding routine that did not fold, but left it up to the message-handling code. -- rjbs
MIME-Version: 1.0
Subject: MIME-Q breaks the header at apostrophes or colons
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-7103-1476114694-1203.69535-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1689
Download (untitled) / with headers
text/plain 1.6k
On Ned Júl 17 11:37:42 2011, VKHERA wrote: Show quoted text
> When encode() is called to encode a mail header using "MIME-Q", it > breaks the header at > apostrophes or colons resulting in extra whitespace when the header is > unfolded by the MUA. > > Example code: > > > #! /usr/local/bin/perl > use strict; > > use Encode qw(encode); > > print "Encode version $Encode::VERSION\n"; > > print encode('MIME-Q',"Subject: Bla Blahbla blah:Blahbl & Blahbla Bla > Blah Bla Can't Blahb > Blahbla Bla. blah blah blah"),"\n"; > print encode('MIME-Q',"Subject: Bla Blahbla blah:Blahbl & Blahbla Bla > Blah Bla Cant Blahb > Blahbla Bla. blah blah blah"),"\n"; > print encode('MIME-Q',"Subject: Bla Blahbla blah Blahbl & Blahbla Bla > Blah Bla Cant Blahb > Blahbla Bla. blah blah blah"),"\n"; > > > The output of the first line splits the word "Can't" at the > apostrophe, and the second one it > splits after "blah:". In both cases when the MUA unfolds the lines, > the extra whitespace > induced is retained, and the message headers, in this case the > Subject, do not match the > original intent. The space after the ":" could be ignored, but the > one in the middle of the > contraction "Can't" is totally wrong. > > This seems related to the tickets: 40027, 63387, and 67569 > > Here's the output I see with Perl 5.10 and 5.12 on FreeBSD 8.2: > > > Encode version 2.43 > Subject: Bla Blahbla blah:Blahbl & Blahbla Bla Blah Bla Can' > t Blahb Blahbla Bla. blah blah blah > Subject: Bla Blahbla blah: > Blahbl & Blahbla Bla Blah Bla Cant Blahb Blahbla Bla. blah blah blah > Subject: > Bla Blahbla blah Blahbl & Blahbla Bla Blah Bla Cant Blahb Blahbla > Bla. blah blah blah
Fixed in Encode 2.83.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.