1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #29830 -- Fixed loss of custom utf-8 body encoding in mails.

This commit is contained in:
jannschu
2018-10-22 12:21:33 -07:00
committed by Tim Graham
parent 043407ec7e
commit efc0f77f02
2 changed files with 17 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ class SafeMIMEText(MIMEMixin, MIMEText):
MIMEText.__setitem__(self, name, val)
def set_payload(self, payload, charset=None):
if charset == 'utf-8':
if charset == 'utf-8' and not isinstance(charset, Charset.Charset):
has_long_lines = any(
len(l.encode()) > RFC5322_EMAIL_LINE_LENGTH_LIMIT
for l in payload.splitlines()