fix(email): Add missing byte-decoding in set_subject
This commit is contained in:
parent
ec20739fee
commit
e5dd924cbe
1 changed files with 3 additions and 0 deletions
|
|
@ -412,6 +412,9 @@ class Email:
|
|||
# assume that the encoding is utf-8
|
||||
self.subject = safe_decode(self.subject)[:140]
|
||||
|
||||
if isinstance(self.subject, bytes):
|
||||
self.subject = self.subject.decode("utf8", "replace") # last resort
|
||||
|
||||
if not self.subject:
|
||||
self.subject = "No Subject"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue