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
Maybe you should try using the Universal Encoding Detector (chardet) library instead of implementing it yourself.
>>> import chardet >>> s = '\xe2\x98\x83' # ☃ >>> chardet.detect(s) {'confidence': 0.505, 'encoding': 'utf-8'}