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

From: Date: Sat, 24 Mar 2012 22:24:53 +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-8434@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=18876&edit=1 ID: 18876 Comment by: alex.volkow@gmail.com Reported By: pear at dlopez 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 Roadmap Versions: New Comment: It seems to be that this site does'nt support russian charset, so I've posted my question to pastebin.com http://pastebin.com/dffYuLBU Previous Comments: ------------------------------------------------------------------------ [2012-03-24 22:20:42] alexvolkow 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! ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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 https://pear.php.net/bugs/bug.php?id=18876&edit=1

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