Skip Menu |

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

Report information
The Basics
Id: 123335
Status: open
Priority: 0/
Queue: MIME-tools

People
Owner: dfs+pause [...] roaringpenguin.com
Requestors: gregoa [...] cpan.org
Cc:
AdminCc:

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



From: gregoa [...] cpan.org
Subject: MIME::Words::encode_mimewords: double-encodes (produces Mojibake), produces too long lines
We have the following bug reported to the Debian package of MIME-tools (https://bugs.debian.org/879205): It doesn't seem to be a bug in the packaging, so you may want to take a look. Thanks! https://rt.cpan.org/Public/Bug/Display.html?id=5462 , closed in 5.504. ------8<-----------8<-----------8<-----------8<-----------8<----- Package: libmime-tools-perl Version: 5.508-1 Severity: normal Perhaps in a misguided attempt to fix #879204, this happens: (sid-amd64)tglase@tglase:~ $ perl -MEncode -MMIME::Words -e 'print MIME::Words::encode_mimewords(Encode::encode("UTF-8", "Re: Bildungsurlaub für CCC-Fahrt? [THD#1424195]"), Charset => "UTF-8", Field => "Subject") . "\n";' Re: Bildungsurlaub =?UTF-8?Q?f=C3=83=C2=BCr=20?=CCC-Fahrt? [THD#1424195] Not only decodes this to… Re: Bildungsurlaub für CCC-Fahrt? [THD#1424195] … but it’s also too long *and* has no space between the encoded MIME part and the next word (“CCC-Fahrt?”), which might cause trouble in strict readers. As in #879204, expected output is something along these lines: tglase@tglase:~ $ php <?php mb_internal_encoding('UTF-8'); echo mb_encode_mimeheader('Subject: Re: Bildungsurlaub für CCC-Fahrt? [THD#1424195]', 'UTF-8', 'Q', "\015\012") . "\n"; Subject: Re: Bildungsurlaub =?UTF-8?Q?f=C3=BCr=20CCC-Fahrt=3F=20=5BTHD=23?= =?UTF-8?Q?=31=34=32=34=31=39=35=5D?= Similar to #787512 and #787513 it saddens me it takes PHP to provide an example of correct output :| -- System Information: Debian Release: buster/sid APT prefers buildd-unstable APT policy: (500, 'buildd-unstable'), (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 4.12.0-1-amd64 (SMP w/8 CPU cores) Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to C.UTF-8), LANGUAGE=C (charmap=UTF-8) (ignored: LC_ALL set to C.UTF-8) Shell: /bin/sh linked to /bin/lksh Init: sysvinit (via /sbin/init) Versions of packages libmime-tools-perl depends on: ii libconvert-binhex-perl 1.125-1 ii libmailtools-perl 2.18-1 ii perl 5.26.0-8 libmime-tools-perl recommends no packages. libmime-tools-perl suggests no packages. -- no debconf information ------8<-----------8<-----------8<-----------8<-----------8<----- Thanks for considering, gregor herrmann, Debian Perl Group
/* The forwardin script ate a line. It should say at the top: */ #879204 refers to https://bugs.debian.org/879204 which is https://rt.cpan.org/Public/Bug/Display.html?id=5462 , closed in 5.504.
Subject: Re: [rt.cpan.org #123335] MIME::Words::encode_mimewords: double-encodes (produces Mojibake), produces too long lines
Date: Fri, 20 Oct 2017 10:32:48 -0400
To: bug-MIME-tools [...] rt.cpan.org
From: Dianne Skoll <dfs [...] roaringpenguin.com>
Hi, I think there's an error in how you are calling MIME::Words::encode_mimewords because I cannot replicate this. Below is my test program: #================================================================ use MIME::Words; use Encode; my $sample = "Re: Bildungsurlaub \x{FC} CCC-Fahrt? [THD#1424195]"; my $utf8 = Encode::encode('UTF-8', $sample); my $out = MIME::Words::encode_mimewords($utf8, Charset => 'UTF-8'); print "Out: $out\n"; #================================================================ and the output is: Out: Re: Bildungsurlaub =?UTF-8?Q?=C3=BC=20?=CCC-Fahrt? [THD#1424195] So it should not be producing mojibake. I'll look into the too-long issue, however. Regards, Dianne.