#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
Reporter: Sergey Gornostaev | Owner: nobody
Type: Bug | Status: closed
Component: Core (Mail) | Version: 1.9
Severity: Normal | Resolution: invalid
Keywords: email attachment, | Triage Stage:
filenames, i18n | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* status: new => closed
* resolution: => invalid
Comment:
It looks like I can't reproduce against master anymore as the issue
manifests itself on Python 2, sorry for the false alarm Tim.
Here's how the attachment is sent on Python 2
{{{
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*="utf-8''%D0%98%D0%BC%D1%8F%20%D1%84%D0%B0%D0%B9%D0%BB%D0%B0"
data
}}}
And on Python 3
{{{
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*=utf-8''%D0%98%D0%BC%D1%8F%20%D1%84%D0%B0%D0%B9%D0%BB%D0%B0
data
}}}
Notice that both use a RFC 2231 `filename*=` parameter but the value is
within double quotes on Python 2 while it isn't on Python 3. That seems to
be the reason why GMail rejects the encoded value.
This was changed in Python 3.1
[https://github.com/python/cpython/commit/dfd7eb0ba2f3296f28028970e395e38f3ae9eedc
dfd7eb] and detailed in [https://bugs.python.org/issue1693546
CPython#1693546]
--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.38c1370bfa33fb4994fee182a4943c1c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.