itswasiqansari / php-mime-mail-parser

Automatically exported from code.google.com/p/php-mime-mail-parser
1 stars 0 forks source link

UTF-8 Decoding for disposition-filename #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. using getAttachments to save attachements
2.
3.

What is the expected output? What do you see instead?
expect output is the correct filename ie: TEST.TXT
what is returned is: =?utf-8?Q?TEST.TXT?= (wich does not save on windows 
o'course)

What version of the product are you using? On what operating system?
Latest version on svn, reproduced on windows xp pro iis 5.1, php 5.2.12 nts

Please provide any additional information below.
i've changed the code in class.MimeMailParser.php in the function 
getAttachments() to check if a UTF-8 string is present: '=?utf-8?Q?' and then 
used the function imap_utf8($part['disposition-filename']) wich do the magic 
against the filename.
not sure if this is the best way but works for me!
ciao
Rob

Original issue reported on code.google.com by oudo...@gmail.com on 28 Sep 2010 at 1:15

GoogleCodeExporter commented 9 years ago
Could you attach the mail message being parsed please. 

Original comment by buca...@gmail.com on 3 Oct 2010 at 7:10

GoogleCodeExporter commented 9 years ago
Hi there!
Well the relevant part is:

Content-Type: text/plain;
    name="=?utf-8?Q?test.txt?="
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="=?utf-8?Q?test.txt?="

The filename can be correctly parsed with imap_utf8().

I think You can reproduce by simply attaching a similar file??
But if u can reproduce i will post the entire email for You.
Your help is very appreciated.
Thanks! Ciao
Rob

Original comment by oudo...@gmail.com on 5 Oct 2010 at 12:42

GoogleCodeExporter commented 9 years ago
I haven't seen this issue before so I wouldn't know what it is specific to. 
Yes, attaching the file would be great. 

Thanks,
Gabe.

Original comment by buca...@gmail.com on 6 Oct 2010 at 1:41

GoogleCodeExporter commented 9 years ago
This issue is reproduced, corrected and tested 
(https://github.com/eXorus/php-mime-mail-parser/issues/4)

You could use my fork if you want : 
https://github.com/eXorus/php-mime-mail-parser

Original comment by eXorus.m...@gmail.com on 28 Jul 2013 at 4:24