List of available codecs

Martin v. Löwis martin at v.loewis.de
Thu May 8 01:19:12 EDT 2003


bokr at oz.net (Bengt Richter) writes:

> How close is
>     import codecs
>     codecList = [x for x in dir(codecs) if x.find('_decode')!=-1 or x.find('_encode')!=-1]
> ?

Almost useless. People would expect "koi8-r", "iso-8859-2", "cp1252",
etc in the result, as these are all strings you can pass to codecs.lookup.

Regards,
Martin





More information about the Python-list mailing list