diff --git a/flanker/mime/message/part.py b/flanker/mime/message/part.py index 0bc83d21..cba82708 100644 --- a/flanker/mime/message/part.py +++ b/flanker/mime/message/part.py @@ -622,7 +622,7 @@ def _encode_charset(preferred_charset, text): try: charset = preferred_charset or 'ascii' text = text.encode(preferred_charset) - except: + except (UnicodeEncodeError, LookupError): charset = 'utf-8' text = text.encode(charset) return charset, text