You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
401 B

import sys
import char_encodings
encoded = bytes.fromhex(sys.argv[1])
decodings = {}
for encoding in char_encodings.encodings:
decoded = encoded.decode(encoding)
except UnicodeDecodeError:
if decoded not in decodings: decodings[decoded] = []
for decoded, encodings in decodings.items():
print(f'{",".join(encodings)}: {repr(decoded)}')