From efc0f77f02de86a94e21cafd3c8409eb7dd99ef6 Mon Sep 17 00:00:00 2001 From: jannschu Date: Mon, 22 Oct 2018 12:21:33 -0700 Subject: Fixed #29830 -- Fixed loss of custom utf-8 body encoding in mails. --- django/core/mail/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') diff --git a/django/core/mail/message.py b/django/core/mail/message.py index 9a0f0eba45..2f89ffbfc4 100644 --- a/django/core/mail/message.py +++ b/django/core/mail/message.py @@ -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() -- cgit v1.3