[Python-Dev] How to add an encoding alias? (original) (raw)

M.-A. Lemburg mal@lemburg.com
Fri, 04 Oct 2002 14:09:22 +0200


Guido van Rossum wrote:

Would it make sense to change the lookup function to convert all punctuation to underscores before doing the lookup? (Then this one would actually have worked...)

Codecs must currently use names as defined by the search function in the encodings package: Codec modules must have names corresponding to standard lower-case encoding names with hyphens mapped to underscores, e.g. 'utf-8' is implemented by the module 'utf8.py'. We could extend this to: Codec modules must have names corresponding to standard lower-case encoding names with all non-alphanumeric charactersmapped to underscores, e.g. 'utf-8' is implemented by the module 'utf8.py' and 'ISO 639:1988' would be implemented as module 'iso6391988'. Note that the aliasing dictionary is consulted after having applied this mapping. +1; +1 on backport to 2.2.2 also. Note that this requires some changes to the dict in aliases.py.

Done.

Not backported to 2.2.2, though, since this is a new feature.

-- Marc-Andre Lemburg CEO eGenix.com Software GmbH


eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/