Setting encoding on EmailMessage does not produce intended result
|Reported by:||oyvind||Owned by:||oyvind|
|Severity:||Keywords:||iso-8859-1 utf-8 smart_str mail header|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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) ...
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 Changed 5 years ago by oyvind
- Keywords iso-8859-1 added; iso-8849-1 removed
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 Changed 5 years ago by russellm
- Resolution set to duplicate
- Status changed from new to closed
comment:5 Changed 5 years ago by russellm
- Resolution duplicate deleted
- Status changed from closed to reopened
- Triage Stage changed from Unreviewed to Accepted
comment:7 Changed 5 years ago by kmtracey
- Resolution set to fixed
- Status changed from reopened to closed