2 # -*- coding: koi8-r -*-
4 from __future__ import print_function
5 from ..lazy.dict import LazyDictInitFunc
8 # Rus -> Lat transliteration (koi2lat and win2lat)
78 def make_xxx2lat(encoding="cp1251"):
80 for k, v in koi2lat_d.items():
85 win2lat_d = LazyDictInitFunc(make_xxx2lat, encoding="cp1251")
88 def rus2lat(instr, rus2lat_d = koi2lat_d):
91 c = rus2lat_d.get(c, c)
92 if isinstance(c, int):
101 return rus2lat(instr, win2lat_d)
104 if __name__ == "__main__":
105 Test = "�������� ����� �����������. ��� xyz ��� ����� �����"
107 print("����:", koi2lat(Test))
108 print("����:", win2lat(Test))