Req #18876 [Com]: getting attachment filename in the desired charset

From: Date: Sat, 24 Mar 2012 22:21:31 +0000
Subject: Req #18876 [Com]: getting attachment filename in the desired charset
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8433@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=18876&edit=1 ID: 18876 Comment by: alexvolkow Reported By: alex dot volkow at gmail dot com Summary: getting attachment filename in the desired charset Status: Closed Type: Feature/Change Request Package: Mail_mimeDecode Operating System: linux Package Version: SVN PHP Version: 5.3.8 Assigned To: alan_k New Comment: Hi, I've a problem with new patch, As an example: Subject: =?KOI8-R?B?8NLJ18XUIQ==?= From: =?KOI8-R?B?4czFy9PBzsTSIPfPzMvP1w==?= <email@gmail.com> Becomes: Subject: ?÷??????????! From: ????????? ?????? <email@gmail.com> It should be as follows, Subject: ??????! So the subject line being modified to KOI8-R , but not to UTF-8. Thanks in advance! Previous Comments: ------------------------------------------------------------------------ [2011-10-04 01:39:00] alan_k Thanks, I think my eyes are going ;) ------------------------------------------------------------------------ [2011-10-03 18:27:16] dlopez Sorry to continue the thread... was there a reason you check the return value of the iconv call after the loop, but not the one inside the loop? I would think it should be in there as well... ------------------------------------------------------------------------ [2011-10-03 07:48:24] alan_k Thanks, well spotted, should be fixed in svn now. Regards Alan ------------------------------------------------------------------------ [2011-09-27 12:06:36] dlopez Holy cow, you're a superhero. I thought this feature request would be on a back-burner (or perhaps had some simple workaround that wasn't clear to me). Kudos to you. Preliminary testing with KOI8 content (and with decode_headers=false) looks good, with two notes: 1) The second argument to _decodeHeaders appears to be a misspelling of $default_charset. It's not broken though because you misspelled it the same way in both places. 2) For greater robustness you might want to check if iconv fails and returns false. For example, if the charset passed via decode_headers is invalid or not supported (I set it to 'foobar' to test), mimeDecode now returns an empty string, which might catch people off-guard. If iconv returns false you may want to leave the value either undecoded or else do the straight decoding as was done prior to this patch. I suppose the latter choice is more backward compatible. ------------------------------------------------------------------------ [2011-09-27 10:20:41] alan_k <div id="changeset"> <span class="removed">-Status: Open</span> <span class="added">+Status: Closed</span> <span class="removed">-Assigned To:</span> <span class="added">+Assigned To: alan_k</span> </div>This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Can you test the changed code. http://svn.php.net/viewvc/pear/packages/Mail_Mime/trunk/mimeDecode.php? r1=317378&r2=317377&pathrev=317378&view=patch ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://pear.php.net/bugs/bug.php?id=18876 -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=18876&edit=1

« previous php.pear.bugs (#8433) next »