How to decode unknown encoded string in python, tried chardet?

824 views Asked by At

I don't know encoding type of string and I want to decode that string. I have tried chardet python module but didn't work.

I know output of string, is there anyway i can decode string using python...

Example

Input
'\x06@\t\xa6'

Output
104860070

Any help would be appreciated

1

There are 1 answers

0
furas On BEST ANSWER

It is text created with struct.pack() so use struct.unpack()

import struct

result = struct.unpack('!i', '\x06@\t\xa6')[0]
print(result) 

# 104860070