I am writing a script that will try encoding bytes into many different encodings in Python 2.6. Is there some way to get a list of available encodings that I can iterate ove
The Python source code has a script at Tools/unicode/listcodecs.py which lists all codecs.
Among the listed codecs, however, there are some that are not Unicode-to-byte converters, like base64_codec, quopri_codec and bz2_codec, as @John Machin pointed out.