Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: ssotka [...] barracudanetworks.com
Cc:
AdminCc:

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

Attachments


MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Subject: Encode::MIME::Headers patch to solve what is probably someone else's bug
Content-Type: multipart/mixed; boundary="----------=_1134180109-18309-0"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 469
Download (untitled) / with headers
text/plain 469b
Yahoo mail in China created the following MIME-Header: =?gb2312?q?Chinese(gb2312)=20=20=C3=C0=B9=FA=C7=B0=CB=BE=B7=A8=B2=BF=B3?= =?gb2312?q?=A4=C3=E6=BC=FB=C8=F8=B4=EF=C4=B7=BA=F3=B3=C6=C6=E4=D7=B4=CC=AC?= =?gb2312?q?=BA=DC=BA=C3=20=20Chinese=20(gb2312)?= They folded the header in the middle of a character such that the result when Encode::MIME::Header decodes it, is incorrect. The attached patch allows proper decoding of cases like this (only for QP). --Scott
Content-Type: text/x-patch; name="Encode-2.09.patch"
Content-Disposition: inline; filename="Encode-2.09.patch"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 631
Download Encode-2.09.patch
text/x-diff 631b
--- Encode-2.09/lib/Encode/MIME/Header.pm 2004-12-03 11:17:01.000000000 -0800 +++ Encode-new/lib/Encode/MIME/Header.pm 2005-12-09 17:22:54.000000000 -0800 @@ -47,6 +47,10 @@ $str =~ s/\?=\s+=\?/\?==\?/gos; # multi-line header to single line $str =~ s/(:?\r|\n|\r\n)[ \t]//gos; + + 1 while ($str =~ s/(\=\?[0-9A-Za-z\-_]+\?[Qq]\?)(.*?)\?\=\1(.*?)\?\=/$1$2$3\?\=/); # Concat consecutive QP encoded mime headers + # Fixes breaking inside multi-byte characters + $str =~ s{ =\? # begin encoded word
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.5.HEAD-22124-1137336920-1660.16413-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 584
Download (untitled) / with headers
text/plain 584b
On Fri Dec 09 21:01:49 2005, SSOTKA wrote: Show quoted text
> Yahoo mail in China created the following MIME-Header: > =?gb2312?q?Chinese(gb2312)
=20=20=C3=C0=B9=FA=C7=B0=CB=BE=B7=A8=B2=BF=B3?= Show quoted text
> =?gb2312?q?
=A4=C3=E6=BC=FB=C8=F8=B4=EF=C4=B7=BA=F3=B3=C6=C6=E4=D7=B4=CC=AC?= Show quoted text
> =?gb2312?q?=BA=DC=BA=C3=20=20Chinese=20(gb2312)?= > > They folded the header in the middle of a character such that the > result when > Encode::MIME::Header decodes it, is incorrect. The attached patch > allows proper decoding of cases like this (only for QP). > > --Scott
Thanks, applied. Dan the Encode Maintainer


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.