0
点赞
收藏
分享

微信扫一扫

utf16be

爱喝酒的幸福人 2024-06-18 阅读 3

 

 

 

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.")

 



举报

相关推荐

0 条评论