#12791 closed (fixed)
Setting encoding on EmailMessage does not produce intended result
Description ¶
class MEmailMessage(EmailMessage): encoding = 'ISO-8859-1'
Produces a message with a header that says it is iso-8859-1, but the quoted-printable-encoded data in the body is utf-8.
class EmailMessage(object): ... def message(self): encoding = self.encoding or settings.DEFAULT_CHARSET msg = SafeMIMEText(smart_str(self.body, settings.DEFAULT_CHARSET), self.content_subtype, encoding) ...
Should be:
class EmailMessage(object): ... def message(self): encoding = self.encoding or settings.DEFAULT_CHARSET msg = SafeMIMEText(smart_str(self.body, encoding), self.content_subtype, encoding) ...
Change History (12)
comment:1 by , 15 years ago
Keywords: | iso-8859-1 added; iso-8849-1 removed |
---|
comment:2 by , 15 years ago
milestone: | 1.3 → 1.2 |
---|
comment:3 by , 15 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:4 by , 15 years ago
Has patch: | set |
---|
by , 15 years ago
Attachment: | emailmessage-body-encoding.2.diff added |
---|
Also works with MIME attachments
by , 15 years ago
Attachment: | emailmessage-body-header-encoding.diff added |
---|
comment:5 by , 15 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Triage Stage: | Unreviewed → Accepted |
Apologies - you are correct. This is a different issue to #11924.
Given that the two issues are distinct, please keep the patches separate.
comment:6 by , 15 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:7 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:8 by , 15 years ago
Note:
See TracTickets
for help on using tickets.
I suspect this is a duplicate of #11924.