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