[Python-ideas] Support WHATWG versions of legacy encodings

Nick Coghlan ncoghlan at gmail.com
Wed Jan 10 19:22:58 EST 2018


On 11 January 2018 at 05:04, M.-A. Lemburg <mal at egenix.com> wrote:
> For the stdlib, I think we should stick to standards and
> not go for spreading non-standard ones.
>
> So -1 on adding WHATWG encodings to the stdlib.

We already support HTML5 in the standard library, and saying "We'll
accept WHATWG's definition of HTML, but not their associated text
encodings" seems like a strange place to draw a line when it comes to
standards support.

I do think your observation constitutes a compelling reason to leave
the existing codecs alone though, and treat the web codecs as a
distinct set of mappings. Given that, I think Rob's original
suggestion of using "web-1252" et al is a good one.

We can also separate them out in the documentation, such that we have
three tables:

* https://docs.python.org/3/library/codecs.html#standard-encodings
(Unicode Consortium)
* https://docs.python.org/3/library/codecs.html#python-specific-encodings
(python-dev/PSF)
* a new table for WHATWG encodings

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list