Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.5

Request #14634 UTF-8 charset header & body decode
Submitted: 2008-09-10 05:44 UTC Modified: 2011-09-05 09:23 UTC
From: clst Assigned:
Status: Duplicate Package: Mail_mimeDecode (version 1.5.0)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2008-09-10 05:44 UTC] clst (Claudius Steinhauser)
Description: ------------ Duplicate of the other UTF-8 header bug. Sorry, but I have a patch :) If the body of an E-Mail is using charset UTF-8 (no matter what encoding (8-bit, quoted-printable, etc.) it uses) it is returned as is. All other E-Mail content usually is not multibyte so I think it would be better to return the decoded body. Test script: --------------- Sample1: Subject: =?Windows-1252?Q?Re:_=5B#320072=5D_t=F6st?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable body: t=E4=E4 t=E4=E4, Sample2: Subject: =?UTF-8?Q?Re:_=5B#320072=5D_t=C3=B6st?= Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit body: tää tää, <encoding could be munged by web form> Expected result: ---------------- Sample1 = Sample2 Actual result: -------------- Sample1: Subject: Re: [#320072] töst body: tää tää, Sample2: Subject: Re: [#320072] töst body: tää tää, <encoding could be munged by web form>

Comments

 [2008-09-10 05:47 UTC] clst (Claudius Steinhauser)
<off topic rant> boy was it hard to submit this... (unknown salt, old bug miraculously disappearing, email already registered, my "+" sign got removed from my mail address) process for first submission without a username should be different (or simply not allowed) </off topic rant>
 [2008-12-27 01:31 UTC] doconnor (Daniel O'Connor)
Thanks for the patch, think you can make your test script an executable one?
 [2009-01-13 12:15 UTC] clst (Claudius Steinhauser)
Test PHP-Script It's base64 encoded because it contains Multibyte(UTF-8) characters. MIME-Version: 1.0 Content-Type: application/octet-stream; name="test_utf8_mail.php" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test_utf8_mail.php" PD9waHANCg0KJG1haWxfd2luMTI1Ml84Yml0PScNCkZyb206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IyMjIyAgw58gwrUgQDx5PnzCp8KnwqcN Cg0KJzsNCg0KZGVmaW5lKCdQRUFSX0RJUicsJy4uL3BlYXIvJyk7DQoNCnJlcXVpcmVfb25jZShQ RUFSX0RJUi4nTWFpbC9taW1lRGVjb2RlLnBocCcpOw0KcmVxdWlyZV9vbmNlKFBFQVJfRElSLidN YWlsL1JGQzgyMi5waHAnKTsNCg0KJG1lc3NhZ2U9JG1haWxfdXRmOF84Yml0Ow0KLy8kbWVzc2Fn ZT0kbWFpbF93aW4xMjUyXzhiaXQ7DQovLyRtZXNzYWdlPSRtYWlsX3dpbjEyNTJfcXA7DQoNCi8v Z2V0IGhlYWRlcjoNCmlmIChwcmVnX21hdGNoKCIvXiguKj8pXHI/XG5ccj9cbiguKikvcyIsJG1l c3NhZ2UsICRtYXRjaCkpIHsNCgkkaGVhZGVyPSRtYXRjaFsxXTsNCn0NCg0KJHBhcmFtcyA9IGFy cmF5KCdjcmxmJyAgICAgICAgICA9PiAiXHJcbiIsDQoJCQkJJ2lucHV0JyAgICAgICAgID0+JG1l c3NhZ2UsDQoJCQkJJ2luY2x1ZGVfYm9kaWVzJz0+IHRydWUsDQoJCQkJJ2RlY29kZV9oZWFkZXJz Jz0+IHRydWUsDQoJCQkJJ2RlY29kZV9ib2RpZXMnID0+IHRydWUpOw0KDQokc3RydWN0PU1haWxf bWltZURlY29kZTo6ZGVjb2RlKCRwYXJhbXMpOw0KcHJpbnQgInN1YmplY3Q6Ii4kc3RydWN0LT5o ZWFkZXJzWydzdWJqZWN0J107DQpwcmludCAiXHJcbmJvZHk6Ii4kc3RydWN0LT5ib2R5Ow0KDQo/ Pg==
 [2011-09-05 09:23 UTC] alan_k (Alan Knowles)
-Status: Open +Status: Duplicate
http://pear.php.net/bugs/bug.php?id=15960&edit=1 See comments there, it should really be the callee's responsibility as enough information is provided to do conversions.