Skip Menu |

This queue is for tickets about the MIME-EncWords CPAN distribution.

Report information
The Basics
Id: 84295
Status: resolved
Priority: 0/
Queue: MIME-EncWords

People
Owner: hatuka [...] nezumi.nu
Requestors: me [...] justinsimoni.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.012.6
Fixed in: 1.013_02



Subject: MaxLineLen is global
The paramater, "MaxLineLen" is global, and can only be set once, in MIME::EcodeWords: #!/usr/bin/perl use MIME::EncWords; use strict; my $value = '<http://example.com/a/very/long/url/that/points/to/something/important/without/any/utf-8/>'; my $MaxLineLen = 76; print "encoded:\n"; print MIME::EncWords::encode_mimewords( $value, Encoding => 'Q', Charset => 'UTF-8', MaxLineLen => $MaxLineLen, ) ; print "\n"; print "no encoded needed:\n"; $MaxLineLen = 1176; print MIME::EncWords::encode_mimewords( $value, Encoding => 'Q', Charset => 'UTF-8', MaxLineLen => $MaxLineLen, ) ; prints, encoded: =?UTF-8?Q?=3Chttp=3A//example=2Ecom/a/very/long/url/that/points/to/somethi?= =?UTF-8?Q?ng/important/without/any/utf-8/=3E?= no encoded needed: =?UTF-8?Q?=3Chttp=3A//example=2Ecom/a/very/long/url/that/points/to/something/important/without/any/utf-8/=3E?= The value set in the "MaxLineLen" in the first call to "encode_mimewords" affects the second call. If you try just: #!/usr/bin/perl use MIME::EncWords; use strict; my $value = '<http://example.com/a/very/long/url/that/points/to/something/important/without/any/utf-8/>'; print "no encoded needed:\n"; my $MaxLineLen = 1176; print MIME::EncWords::encode_mimewords( $value, Encoding => 'Q', Charset => 'UTF-8', MaxLineLen => $MaxLineLen, ) ; prints: no encoded needed: <http://example.com/a/very/long/url/that/points/to/something/important/without/any/utf-8/>
Hi, On 2013-3月-29 金 15:28:40, JJSIMONI wrote: Show quoted text
> The value set in the "MaxLineLen" in the first call to > "encode_mimewords" affects the second call.
The second try seems to generate longer line than the first for me. Would you please tell me which is affected by the first setting? Best regards, --- Soji
Justin, I misunderstood your report. It is really a bug. Would you please check attached patch? Regards, --- nezumi
Subject: MIME-EncWords-RT84295.patch
Index: lib/MIME/EncWords.pm =================================================================== --- lib/MIME/EncWords.pm (リビジョン 98) +++ lib/MIME/EncWords.pm (作業コピー) @@ -714,8 +714,8 @@ # unsafe ASCII sequences my $UNSAFEASCII = ($maxrestlen <= 1)? qr{(?: =\? )}ox: - qr{(?: =\? | [$PRINTABLE]{$Params{MaxLineLen}} )}ox; - $UNSAFEASCII = qr{(?: [$DISPNAMESPECIAL] | $UNSAFEASCII )}ox + qr{(?: =\? | [$PRINTABLE]{$Params{MaxLineLen}} )}x; + $UNSAFEASCII = qr{(?: [$DISPNAMESPECIAL] | $UNSAFEASCII )}x if $Params{Minimal} eq 'DISPNAME'; unless (ref($words) eq "ARRAY") {
On Wed Apr 10 23:59:42 2013, NEZUMI wrote: Show quoted text
> I misunderstood your report. It is really a bug. > Would you please check attached patch?
The patch seemed to fix the issue I've reported
On 2013-4月-26 金 12:31:49, JJSIMONI wrote: Show quoted text
> On Wed Apr 10 23:59:42 2013, NEZUMI wrote:
> > I misunderstood your report. It is really a bug. > > Would you please check attached patch?
> > > The patch seemed to fix the issue I've reported
Okey, 1.014 was released. Thank you.