So I have a bytes object but not sure of its encoding, but know it is not utf-8:
a.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9a in position 0: invalid start byte
What I would like to do is something like:
for encoding in encodings:
try:
a.decode(encoding)
print("This is it!", encoding)
except Exception:
pass
How do you get Python to give you everything that will go into .decode
as a list encodings
so I can plug it in there?