Merge branch 'main' of ssh://git.tishenko.dev:27177/univer-6th-semester/software-testing

This commit is contained in:
2025-04-30 18:08:07 +03:00

View File

@@ -2,7 +2,14 @@
def fix_encoding(text): def fix_encoding(text):
fixed_text = text.encode("latin1").decode("windows-1251") result = []
for ch in text:
try:
decoded = ch.encode("latin1").decode("windows-1251")
result.append(decoded)
except (UnicodeEncodeError, UnicodeDecodeError):
result.append(ch)
fixed_text = "".join(result)
fixed_text = fixed_text.replace("ј", "ё") fixed_text = fixed_text.replace("ј", "ё")
fixed_text = fixed_text.replace("ѕ", "<<") fixed_text = fixed_text.replace("ѕ", "<<")
fixed_text = fixed_text.replace("ї", ">>") fixed_text = fixed_text.replace("ї", ">>")