Даулетбек Досай 404 группа (КФ) EncPairs 15919
Жангирхан Шаку, 404 EncPairs 15698
f1import sysf1import sys
n2input_data = sys.stdin.buffer.read()n2data = sys.stdin.buffer.read()
3codecs = ['koi8-r', 'cp1251', 'mac-cyrillic', 'cp866', 'iso8859_5', 'cp83encodings = ['koi8-r', 'cp1251', 'mac-cyrillic', 'cp866', 'iso8859_5', '
>55']>cp855']
4is_text_found = False4found = False
5for original_encoding in codecs:5for orig_enc in encodings:
6    for intermediate_encoding in codecs:6    for trans_src_enc in encodings:
7        for target_encoding in codecs:7        for trans_tgt_enc in encodings:
8            try:8            try:
n9                intermediate_str = input_data.decode(target_encoding)n9                unicode_str = data.decode(trans_tgt_enc)
10                reencoded_data = intermediate_str.encode(intermediate_en10                data_in_trans_src_enc = unicode_str.encode(trans_src_enc
>coding)>)
11                final_text = reencoded_data.decode(original_encoding)11                decoded_text = data_in_trans_src_enc.decode(orig_enc)
12                if 'Зимбабве' in final_text:12                if 'Зимбабве' in decoded_text:
13                    print(final_text)13                    print(decoded_text)
14                    is_text_found = True14                    found = True
15                    break15                    break
16            except (UnicodeDecodeError, UnicodeEncodeError):16            except (UnicodeDecodeError, UnicodeEncodeError):
17                continue17                continue
n18        if is_text_found:n18        if found:
19            break19            break
n20    if is_text_found:n20    if found:
21        break21        break
t22if not is_text_found:t22if not found:
23    print('Failed to recover the original text.')23    print('Could not recover the original text.')
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op