Re: IANA names for character set encodings?

"Fredrik Lundh" <[email protected]>
Newsgroups gmane.comp.python.internationalization
Organization Secret Labs AB
Message-ID <010901c1b15f$0bc03580$ced241d5@hagrid>
mal wrote:
> How large would such an alias dictionary be ? 
> 
> Looking at the IANA listing it seems rather lengthy. What I'm
> worried about is that Python startup time will get worse for
> programs using codecs (I sometimes wish Python had a builtin
> on-disk registry where we could put static data like this).

why split it up in two parts; put common aliases in one table
(latin*, utf*, us-ascii, iso-8858, iso-2022, and perhaps some
more), put that table inside __init__, and change the search
function to:

    1) look for a common aliases in the small table
    2) try importing the module
    3) if import fails, import "aliases", look it up in the
       big table, and try again

in this way, people who use the "true" names and commonly
used aliases won't have to load the big alias table at all.

</F>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.