--
Ticket URL: <https://code.djangoproject.com/ticket/23949>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Can you clarify why this change is needed?
--
Ticket URL: <https://code.djangoproject.com/ticket/23949#comment:1>
Comment (by bronger):
Because I like don't like ambiguity, I overrode the `content_type`
parameter in order to have a `charset`. But it would be nice if I needn't
do this anymore in an upcoming Django version. It is a cosmetical problem
I admit. The HTTP standard only states a default charset for `text/*`
(namely 8859-1), so a client has to guess in case of `application/*` and
in absence of `charset`, so I think it is good habit to make it explicit.
Besides, there are no disadvantages, and it is a simple change.
--
Ticket URL: <https://code.djangoproject.com/ticket/23949#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
According to [http://tools.ietf.org/html/rfc7159#page-11 RFC 7159], "No
"charset" parameter is defined for this registration. Adding one really
has no effect on compliant recipients."
See also [https://github.com/mitsuhiko/flask/issues/454 the same report in
flask] which was closed as invalid.
--
Ticket URL: <https://code.djangoproject.com/ticket/23949#comment:3>
Comment (by tomchristie):
Confirming tim's resolution. JSON responses in REST framework also don't
include the charset, for the same reason.
--
Ticket URL: <https://code.djangoproject.com/ticket/23949#comment:4>
Comment (by int-ua):
What do you think about defaulting to UTF-8? Right now it's ASCII, AFAIU.
While the RFC clearly recommends UTF. Should I bother opening new ticket
for this?
--
Ticket URL: <https://code.djangoproject.com/ticket/23949#comment:5>
Comment (by timgraham):
I believe it defaults to `settings.DEFAULT_CHARSET` which is 'utf-8' by
default.
--
Ticket URL: <https://code.djangoproject.com/ticket/23949#comment:6>