* owner: ccahoon => aaugustin
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:19>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:20>
* status: assigned => new
* owner: aaugustin =>
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:21>
* owner: => unaizalakain
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:22>
* stage: Fixed on a branch => Accepted
Comment:
PR sent: https://github.com/django/django/pull/1928
``HttpResponse``s charset is now depending on its ``Content-Type`` header
key.
If no charset is found there, it falls back to the ``DEFAULT_CHARSET``
setting.
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:23>
* needs_better_patch: 0 => 1
* needs_docs: 0 => 1
Comment:
This latest patch doesn't address the fact that Python charsets do not
match IANA-registered character sets. What's your take on this issue?
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:24>
* needs_better_patch: 1 => 0
* needs_docs: 1 => 0
Comment:
For the sake of future readers, this is what we have spoken on IRC
(`#django-dev`):
There are two possible workarounds to this:
- Creating a dictionary between IANA registered charsets and Python
charsets. This would be great but it means having to regularly update and
maintain it.
- Adding a `charset` initialization parameter and property to
`HttpResponse`. If you have issues with the charset specification, just
pass on the charset argument or set the charset property. If not set,
it'll fall back to the extraction from the `Content-Type` response header
and if that isn't possible, to the `DEFAULT_CHARSET` setting.
Finally, we decided for the second solution.
We also spoke about parsing the `Accept-Charset` request header so that
the chain would be:
`[charset parameter/property] ---> [content-type extraction] ---> [accept-
charset extraction] ---> [default setting]`
The problem with it was that the `HttpResponse` object could not possibly
know what the request headers were. It's sad to have this limitation but
there isn't any easy workaround.
So, apart of making the changes suggested in the review, I only added the
charset parameter and property.
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:25>
* owner: unaizalakain => aaugustin
Comment:
Tentatively assigning the ticket to myself to review the latest iteration
of the patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:26>
Comment (by unaizalakain):
Any updates so far?
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:27>
* cc: unai@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:28>
* owner: aaugustin =>
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:29>
* needs_better_patch: 0 => 1
Comment:
I left comments for improvement on the PR. Please uncheck "Patch needs
improvement" when you update it, thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:30>
* needs_better_patch: 1 => 0
Comment:
Comments addressed and PR updated ;-)
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:31>
* owner: => Tim Graham <timograham@…>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"5f2542f12a90cfcfb7be776424ef2f7b200df006"]:
{{{
#!CommitTicketReference repository=""
revision="5f2542f12a90cfcfb7be776424ef2f7b200df006"
Fixed #10190 -- Made HttpResponse charset customizable.
Thanks to Simon Charette, Aymeric Augustin, and Tim Graham
for reviews and contributions.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/10190#comment:32>