Subject: | wasteful chunk separation |
encode_mimewords() sometimes puts parts of words in separate
chunks without any reason to do so, resulting in an encoded
string that is longer than it needs to be. Example:
use strict;
use warnings;
use MIME::EncWords qw(encode_mimewords);
my $input =
qq{ZfkrdiN\xfcvqrtmmy: Qsaherpjramvve sh Adkbufmikqe cv } .
qq{mmq Raqsylw-J\xf6jggexbj};
my $output = encode_mimewords($input, Field => 'Subject');
print "Subject: $output\n";
This prints:
Subject: =?ISO-8859-1?Q?ZfkrdiN=FCvqrtmmy=3A?= Qsaherpjramvve sh Adkbufmikqe
cv mmq =?ISO-8859-1?Q?Raqsy?= =?ISO-8859-1?Q?lw-J=F6jggexbj?=
I would have expected it to print:
Subject: =?ISO-8859-1?Q?ZfkrdiN=FCvqrtmmy=3A?= Qsaherpjramvve sh Adkbufmikqe
cv mmq =?ISO-8859-1?Q?Raqsylw-J=F6jggexbj?=
I suspect that the extra chunk is supposed to prepare
splitting of a particularly long word into separate
lines, but the trigger to detect such words is somehow
off the mark.
-Martin