This commit is contained in:
mxsgd 2024-01-18 15:17:03 +01:00
parent f4afb37947
commit ee7d0e9e08
2 changed files with 50017 additions and 0 deletions

File diff suppressed because one or more lines are too long

17
TaskG05/run.py Normal file
View File

@ -0,0 +1,17 @@
import sys
import binascii
def hex_to_utf8(hex_string):
hex_string = hex_string.replace(' ', '').replace('0x', '')
bytes_data = binascii.unhexlify(hex_string)
try:
utf8_text = bytes_data.decode('utf-8')
except UnicodeDecodeError:
utf8_text = bytes_data.decode('utf-8', errors='replace')
return utf8_text
for line in sys.stdin:
result_text = hex_to_utf8(line.strip())
print(result_text.encode('utf-8'))