Opened 13 years ago

Closed 12 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)

mail_attachment.diff (1.1 KB ) - added by antonyc 13 years ago.
The diff between trunk as of 2010-12-24 21:19:48 handling non ASCII filenames in email attachments
14964-2.diff (1.8 KB ) - added by Claude Paroz 12 years ago.
Handle non ASCII filenames v2 + test

Download all attachments as: .zip

Change History (8)

by antonyc, 13 years ago

Attachment: mail_attachment.diff added

The diff between trunk as of 2010-12-24 21:19:48 handling non ASCII filenames in email attachments

comment:1 by Russell Keith-Magee, 13 years ago

Component: Core frameworkdjango.core.mail
Has patch: set
Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:2 by anonymous, 13 years ago

Severity: Normal
Type: New feature

comment:3 by anonymous, 12 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.

by Claude Paroz, 12 years ago

Attachment: 14964-2.diff added

Handle non ASCII filenames v2 + test

comment:4 by Claude Paroz, 12 years ago

Needs tests: unset
Patch needs improvement: unset
Type: New featureBug

comment:5 by Ramiro Morales, 12 years ago

Triage Stage: AcceptedReady for checkin

#17536 was a duplicate.

comment:6 by Ramiro Morales, 12 years ago

Resolution: fixed
Status: newclosed

In [17375]:

Made email attachment handling code accept non-ASCII filenames.

Thanks to Anton Chaporgin for the report and to Claude Paroz for the patch.

Fixes #14964.

Note: See TracTickets for help on using tickets.
Back to Top