J
janwillem
I have a script that extracts attachments from all emails in a mbox
(largely based on http://code.activestate.com/recipes/302086-strip-attachments-from-an-email-message/;
thanks ActiveState). It works fine until it encounters an attachment
with a unicode file name (Ukrainian in my case). I cannot get working
the line
msg.set_payload(replace)
which is line 39 in the activestate snippet.
How can you get the unicode file name into the replace string of line
35 of the snippet:
replace = ReplaceString % dict(content_type=ct,
filename=fn,
params=params)
without getting this nasty error message about ascii encoding?
(largely based on http://code.activestate.com/recipes/302086-strip-attachments-from-an-email-message/;
thanks ActiveState). It works fine until it encounters an attachment
with a unicode file name (Ukrainian in my case). I cannot get working
the line
msg.set_payload(replace)
which is line 39 in the activestate snippet.
How can you get the unicode file name into the replace string of line
35 of the snippet:
replace = ReplaceString % dict(content_type=ct,
filename=fn,
params=params)
without getting this nasty error message about ascii encoding?