Reputation: 23
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
Upvotes: 2
Views: 853
Reputation: 142641
It is text created with struct.pack()
so use struct.unpack()
import struct
result = struct.unpack('!i', '\x06@\t\xa6')[0]
print(result)
# 104860070
Upvotes: 1