2024-01-18 15:09:46 +01:00
|
|
|
import re
|
|
|
|
import sys
|
|
|
|
|
|
|
|
def binary_to_utf8(binary_string):
|
2024-01-29 21:35:28 +01:00
|
|
|
|
2024-01-18 15:09:46 +01:00
|
|
|
|
|
|
|
bytes_list = [binary_string[i:i+8] for i in range(0, len(binary_string), 8)]
|
|
|
|
|
|
|
|
decimal_list = [int(byte, 2) for byte in bytes_list]
|
|
|
|
|
|
|
|
bytes = bytearray(decimal_list)
|
|
|
|
try:
|
|
|
|
utf8_text = bytes.decode('utf-8')
|
|
|
|
except UnicodeDecodeError:
|
|
|
|
utf8_text = bytes.decode('utf-8', errors='replace')
|
|
|
|
|
|
|
|
return utf8_text
|
|
|
|
|
|
|
|
for line in sys.stdin:
|
|
|
|
result = binary_to_utf8(line.strip())
|
2024-01-29 21:35:28 +01:00
|
|
|
print(result)
|