Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] How to add an encoding alias?

M.-A. Lemburgmal@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 'utf_8.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 'utf_8.py'>>     and 'ISO 639:1988' would be implemented as module 'iso_639_1988'.>>>>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 LemburgCEO 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/


[8]ページ先頭

©2009-2025 Movatter.jp