def replace_symbols(input_file, output_file): replacements = { '@128;': '€', '@130;': '‚', '@131;': 'ƒ', '@132;': '„', '@133;': '…', '@134;': '†', '@135;': '‡', '@136;': 'ˆ', '@137;': '‰', '@138;': 'Š', '@139;': '‹', '@140;': 'Œ', '@142;': 'Ž', '@145;': '‘', '@146;': '’', '@147;': '“', '@148;': '”', '@149;': '•', '@150;': '–', '@151;': '—', '@152;': '˜', '@153;': '™', '@154;': 'š', '@155;': '›', '@156;': 'œ', '@158;': 'ž', '@159;': 'Ÿ', '@160;': ' ', '@161;': '¡', '@162;': '¢', '@163;': '£', '@164;': '¤', '@165;': '¥', '@166;': '¦', '@167;': '§', '@168;': '¨', '@169;': '©', '@170;': 'ª', '@171;': '«', '@172;': '¬', '@173;': '­', '@174;': '®', '@175;': '¯', '@176;': '°', '@177;': '±', '@178;': '²', '@179;': '³', '@180;': '´', '@181;': 'μ', '@182;': '¶', '@183;': '·', '@184;': '¸', '@185;': '¹', '@186;': 'º', '@187;': '»', '@188;': '¼', '@189;': '½', '@190;': '¾', '@191;': '¿', '@192;': 'À', '@193;': 'Á', '@194;': 'Â', '@195;': 'Ã', '@196;': 'Ä', '@197;': 'Å', '@198;': 'Æ', '@199;': 'Ç', '@200;': 'È', '@201;': 'É', '@202;': 'Ê', '@203;': 'Ë', '@204;': 'Ì', '@205;': 'Í', '@206;': 'Î', '@207;': 'Ï', '@208;': 'Ð', '@209;': 'Ñ', '@210;': 'Ò', '@211;': 'Ó', '@212;': 'Ô', '@213;': 'Õ', '@214;': 'Ö', '@215;': '×', '@216;': 'Ø', '@217;': 'Ù', '@218;': 'Ú', '@219;': 'Û', '@220;': 'Ü', '@221;': 'Ý', '@222;': 'Þ', '@223;': 'ß', '@224;': 'à', '@225;': 'á', '@226;': 'â', '@227;': 'ã', '@228;': 'ä', '@229;': 'å', '@230;': 'æ', '@231;': 'ç', '@232;': 'è', '@233;': 'é', '@234;': 'ê', '@235;': 'ë', '@236;': 'ì', '@237;': 'í', '@238;': 'î', '@239;': 'ï', '@240;': 'ð', '@241;': 'ñ', '@242;': 'ò', '@243;': 'ó', '@244;': 'ô', '@245;': 'õ', '@246;': 'ö', '@252;': 'ü', '@253;': 'ý', '@254;': 'þ', '@255;': 'ÿ', } with open(input_file, "r", encoding="utf-8") as f: content = f.read() for old, new in replacements.items(): content = content.replace(old, new) with open(output_file, "w", encoding="utf-8") as f: f.write(content) if __name__ == "__main__": input_path = "../transliterationFiles/ZL3b-n.txt" output_path = "../transliterationFiles/ZL3b-n_updated.txt" replace_symbols(input_path, output_path) print("Replacement complete.")