[issue8922] Improve encoding shortcuts in PyUnicode_AsEncodedString()

Marc-Andre Lemburg report at bugs.python.org
Thu Jun 10 12:35:02 CEST 2010


Marc-Andre Lemburg <mal at egenix.com> added the comment:

STINNER Victor wrote:
> 
> STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> 
>> Note that these shortcut bypass the codec registry logic.
> 
> Yes, but it's already the case without my patch. I don't think that it's really useful to override latin1, utf-8, utf-16, utf-32 or mbcs. I prefer a faster Python :-) 

Depends on your use case. E.g. utf-32 is hardly ever used in practice,
utf-16 is only common on Windows and then only as utf-16-le,
I'm not sure about mbcs since that's a meta-codec. In reality, this
will likely be the same as cp1252 most of the time.

I'm ok on ascii, latin1, utf-8 and mbcs (including the additional
normalization, aliasiing and case mapping), but not on the others.

>> we have to be careful about adding more such shortcuts.
> 
> I just want to add a shortcut for ISO-8859-1.

Fine, even though that name is really not used much in Python code.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8922>
_______________________________________


More information about the Python-bugs-list mailing list