Re: mail attachment with non-ascii name

2005-12-12 Thread Bernard Delmée
Thank you Neil, that is what I needed. B. Neil Hodgson wrote: > > >>> import email.Header > >>> x = '=?iso-8859-1?q?somefile=2ezip?=' > >>> email.Header.decode_header(x) > [('somefile.zip', 'iso-8859-1')] > >Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: mail attachment with non-ascii name

2005-12-11 Thread Neil Hodgson
Bernard Delmée: > I am using the "email" module to decode incoming messages. > (with msg = email.message_from_file( msg_file )) > Sometimes an attachment has its name (as returned by > msg.walk().part.get_filename()) not in ASCII (e.g. > '=?iso-8859-1?q?somefile=2ezip?=') How can I turn that into

mail attachment with non-ascii name

2005-12-11 Thread Bernard Delmée
I am using the "email" module to decode incoming messages. (with msg = email.message_from_file( msg_file )) Sometimes an attachment has its name (as returned by msg.walk().part.get_filename()) not in ASCII (e.g. '=?iso-8859-1?q?somefile=2ezip?=') How can I turn that into simply 'somefile.zip' ? I h