Programmatically discovering encoding types supported by codecs module

python at bdurham.com python at bdurham.com
Wed Mar 24 13:58:47 EDT 2010


Gabriel,

> After looking at how things are done in codecs.c and encodings/__init__.py  I think you should enumerate all modules in the encodings package that define a getregentry function. Aliases come from encodings.aliases.aliases.

Thanks for looking into this for me. Benjamin Kaplan made a similar
observation. My reply to him included the snippet of code we're using to
generate the actual list of encodings that our software will support
(thanks to Python's codecs and encodings modules).

Your help is always appreciated :)

Regards,
Malcolm


----- Original message -----
From: "Gabriel Genellina" <gagsl-py2 at yahoo.com.ar>
To: python-list at python.org
Date: Wed, 24 Mar 2010 14:39:20 -0300
Subject: Re: Programmatically discovering encoding types supported by
codecs    module

En Wed, 24 Mar 2010 13:17:16 -0300, <python at bdurham.com> escribió:

> Is there a way to programmatically discover the encoding types
> supported by the codecs module?
>
> For example, the following link shows a table with Codec,
> Aliases, and Language columns.
> http://docs.python.org/library/codecs.html#standard-encodings
>
> I'm looking for a way to programmatically generate this table
> through some form of module introspection.


-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list