可以使用 Python 的内置函数 bytes.fromhex()
来将二进制字符串解码为 ASCII 字符串。
binary_string ="01101000 01100101 01101100 01101100 01101111"
hex_string = "".join(binary_string.split())
decoded_string = bytes.fromhex(hex_string).decode("utf-8")
print(decoded_string)
可以使用 Python 的内置函数 bytes.fromhex()
来将二进制字符串解码为 ASCII 字符串。
binary_string ="01101000 01100101 01101100 01101100 01101111"
hex_string = "".join(binary_string.split())
decoded_string = bytes.fromhex(hex_string).decode("utf-8")
print(decoded_string)