#12422: Django overrides the default email charset behaviour for utf-8
-------------------------------+------------------------------------
Reporter: simonb | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution:
Keywords: charset utf-8 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Description changed by aaugustin:
Old description:
> # Don't BASE64-encode UTF-8 messages so that we avoid unwanted attention
> from
> # some spam filters.
> Charset.add_charset('utf-8', Charset.SHORTEST, Charset.QP, 'utf-8')
>
> The above bit of code in django.core.mail overrides the standard Python
> behaviour for utf-8 in the Python email module. It would be better to set
> the charset by calling set_charset() on the Message before sending if
> needed rather than a global override. This behaviour and assumption is
> not documented anywhere in Django as far as I can tell. I think this is a
> case of the framework being a bit too clever. Not everyone using Django
> is using the django email sending methods nor wants Django to (silently)
> change the system defaults.
>
> For example, I use the standard Python email sending methods and was
> expecting the Python lib to behave as advertised but the encoding of my
> utf-8 messages kept coming out quoted-printable because of the override
> above.
New description:
{{{
# Don't BASE64-encode UTF-8 messages so that we avoid unwanted attention
from
# some spam filters.
Charset.add_charset('utf-8', Charset.SHORTEST, Charset.QP, 'utf-8')
}}}
The above bit of code in django.core.mail overrides the standard Python
behaviour for utf-8 in the Python email module. It would be better to set
the charset by calling set_charset() on the Message before sending if
needed rather than a global override. This behaviour and assumption is not
documented anywhere in Django as far as I can tell. I think this is a case
of the framework being a bit too clever. Not everyone using Django is
using the django email sending methods nor wants Django to (silently)
change the system defaults.
For example, I use the standard Python email sending methods and was
expecting the Python lib to behave as advertised but the encoding of my
utf-8 messages kept coming out quoted-printable because of the override
above.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/12422#comment:6>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.