Closed vovkkk closed 5 years ago
hey man just seen your patch. i'd propose the following one in order to only encode to utf-8 if it is needed :)
try:
attachment_fname = decode_header(part.get_filename())
except UnicodeEncodeError:
attachment_fname = decode_header(part.get_filename().encode("utf-8"))