Is it possible to check in Python whether this encoding exists or is installed. For example:check ('iso-8859-1') โ Truecheck ('bla') โ False
You can use the lookup() function in the codecs module. It throws an exception if the codec does not exist:
lookup()
codecs
import codecs def exists_encoding(enc): try: codecs.lookup(enc) except LookupError: return False return True exists_encoding('latin1')