utf16be

 

 

 

hex_data = "77 1f 80 6a 66 0e ff 0c 88 ab 4f 60 53 d1 73 b0 62 11 76 84 96 90 85 cf 4e cb 7e cd 4e 86 30 02 00"
bytes_data = bytes.fromhex(hex_data.replace(" ", ""))

try:
utf16be_string = bytes_data.decode('utf-16be', errors='ignore')
print("UTF-16BE: ", utf16be_string)
except UnicodeDecodeError:
print("The data cannot be decoded as UTF-16BE.")

try:
utf16le_string = bytes_data.decode('utf-16le', errors='ignore')
print("UTF-16LE: ", utf16le_string)
except UnicodeDecodeError:
print("The data cannot be decoded as UTF-16LE.")

 

posted @ 2024-06-12 14:14  AngDH  阅读(4)  评论(0编辑  收藏  举报