#12791 closed (fixed)
Setting encoding on EmailMessage does not produce intended result
| Reported by: | oyvind | Owned by: | oyvind |
|---|---|---|---|
| Component: | Core (Mail) | Version: | dev |
| 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 |
| Easy pickings: | no | UI/UX: | no |
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)
...
Attachments (3)
Change History (12)
comment:1 by , 16 years ago
| Keywords: | iso-8859-1 added; iso-8849-1 removed |
|---|
comment:2 by , 16 years ago
| milestone: | 1.3 → 1.2 |
|---|
comment:3 by , 16 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
comment:4 by , 16 years ago
| Has patch: | set |
|---|
by , 16 years ago
| Attachment: | emailmessage-body-encoding.2.diff added |
|---|
Also works with MIME attachments
by , 16 years ago
| Attachment: | emailmessage-body-header-encoding.diff added |
|---|
comment:5 by , 16 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 , 16 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:7 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
comment:8 by , 16 years ago
Note:
See TracTickets
for help on using tickets.
I suspect this is a duplicate of #11924.