This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ezio.melotti, python-dev, scop, serhiy.storchaka, vstinner
Date 2016-09-05.22:51:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473115867.75.0.0964742137048.issue27938@psf.upfronthosting.co.za>
In-reply-to
Content
> See also get_standard_encoding() in Python/codecs.c. I suppose it is faster.

I understand that PyCodec_SurrogatePassErrors() is already called with a normalized encoding name.

With my enhanced _Py_normalize_encoding(), strange syntaxes like " utf 8 " also take the fast path.


> UTF-32 is rarely used as external encoding, but ...

Ok, I used the same design than get_standard_encoding() to match the "utf" prefix, so having a fast-path for UTF-16 and UTF-32 doesn't add new strcmp() for "latin9".

I pushed my change, so I close the issue.
History
Date User Action Args
2016-09-05 22:51:07vstinnersetrecipients: + vstinner, scop, ezio.melotti, python-dev, serhiy.storchaka
2016-09-05 22:51:07vstinnersetmessageid: <1473115867.75.0.0964742137048.issue27938@psf.upfronthosting.co.za>
2016-09-05 22:51:07vstinnerlinkissue27938 messages
2016-09-05 22:51:07vstinnercreate