Bugs item #1078919, was opened at 2004-12-04 07:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1078919&group_id=5470
Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tessa Lau (tlau) Assigned to: Nobody/Anonymous (nobody) Summary: Email.Header encodes non-ASCII content incorrectly Initial Comment: I'm generating a MIME message with an attachment whose filename includes non-ASCII characters. I create the MIME header as follows: msg.add_header('Content-Disposition', 'attachment', filename=u'Fu\xdfballer_sind_klug.ppt') The Python-generated header looks like this: Content-disposition: =?utf-8?b?YXR0YWNobWVudDsgZmlsZW5hbWU9IkZ1w59iYWxsZXJf?= =?utf-8?q?sind=5Fklug=2Eppt=22?= I sent messages with this header to Gmail, evolution, and thunderbird, and none of them correctly decode that header to suggest the correct default filename. However, I've found that those three mailers do behave correctly when the header looks like this instead: Content-disposition: attachment; filename="=?iso-8859-1?q?Fu=DFballer=5Fsind=5Fklug=2Eppt?=" Is there a way to make Python's email module generate a Content-disposition header that works with common MUAs? I know I can manually encode the filename before passing it to add_header(), but it seems that Python should be doing this for me. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1078919&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com