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

Guido van Rossum guido@python.org
Thu, 26 Sep 2002 16:03:05 -0400


> Guido van Rossum wrote:
> >   import encodings.aliases
> >   encodings.aliases.aliases['ansi-x3-4-1968'] = 'ascii'
> 
> In order for the lookup to work, you have to replace hyphens
> with underscores; see the top of aliases.py.

Good catch!  Then my "fix" to aliases.py was also wrong.

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...)

--Guido van Rossum (home page: http://www.python.org/~guido/)