2 # -*- coding: koi8-r -*-
4 from __future__ import print_function
5 from ..lazy.dict import LazyDictInitFunc
8 # Rus -> Lat transliteration (koi2lat and win2lat)
80 def make_xxx2lat(encoding="cp1251"):
82 for k, v in koi2lat_d.items():
87 win2lat_d = LazyDictInitFunc(make_xxx2lat, encoding="cp1251")
90 def rus2lat(instr, rus2lat_d = koi2lat_d):
93 c = rus2lat_d.get(c, c)
94 if isinstance(c, int):
103 return rus2lat(instr, win2lat_d)
106 if __name__ == "__main__":
107 Test = "�������� ����� �����������. ��� xyz ��� ����� �����"
109 print("����:", koi2lat(Test))
110 print("����:", win2lat(Test))