-snip-def get_encoded(st, encodings): "Returns an encoding that doesn't fail" for encoding in encodings: try: st_encoded = st.decode(encoding) return st_encoded, encoding except UnicodeError: pass
This works fine, but after this you have three possible encodings (or even more, looking at the data in the net you'll see a lot of encodings...)- what we need is just one for all.
Chris
--
http://mail.python.org/mailman/listinfo/python-list