Opened 14 years ago
Closed 13 years ago
#14964 closed Bug (fixed)
create_attachment support for unicode symbols in filename
Reported by: | Anton Chaporgin | Owned by: | nobody |
---|---|---|---|
Component: | Core (Mail) | Version: | dev |
Severity: | Normal | Keywords: | email attachment, filenames, i18n |
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
When attaching a file containing non ASCII symbols, the standarts required adding special prefix to the filename. For example, when file name is in unicode, like u"Имя Файла.txt" ("filename.txt" in english), the headers in the letter should be
filename: "UTF-8%C3%90%C2%98%C3%90%C2%BC%C3%91%C2%8F%20%C3%90%C2%A4%C3%90%C2%B0%C3%90%C2%B9%C3%90%C2%BB%C3%90%C2%B0.txt"
So, I suggest adding special check for this case in "_create_attachment" method of EmailMessage class, see attached diff.
Attachments (2)
Change History (8)
by , 14 years ago
Attachment: | mail_attachment.diff added |
---|
comment:1 by , 14 years ago
Component: | Core framework → django.core.mail |
---|---|
Has patch: | set |
Needs tests: | set |
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:3 by , 13 years ago
Easy pickings: | unset |
---|---|
UI/UX: | unset |
The standard library Header class might be a better way to do this. It handles various RFCs.
comment:4 by , 13 years ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
Type: | New feature → Bug |
My patch was inspired by http://docs.python.org/library/email.message.html#email.message.Message.add_header
The diff between trunk as of 2010-12-24 21:19:48 handling non ASCII filenames in email attachments