GuiCreate("Translit",374,147,399,319) $button1=GuiCtrlCreateButton("Translit",195,51,52,22) $input1=GuiCtrlCreateInput("Text for translit",14,52,145,20) $label1=GuiCtrlCreateLabel("E-Mail : skeletonmania@yandex.ru",208,126,147,15) GuiSetState() Func button1() $sCyrrilicString = "Привет" $sTranslitString = _Translit_Proc($sCyrrilicString) MsgBox(64, "Перевод состоялся", $sCyrrilicString & @CRLF & $sTranslitString) Func _Translit_Proc($sStringToTranslit) Local $sCyrrilicTable = 'а|б|в|г|д|е|ё|ж|з|и|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ь|ъ|ы|э|ю|я' $sCyrrilicTable &= '|' & StringUpper($sCyrrilicTable) Local $sLatinTable = 'a|b|v|g|d|e|yo|zh|z|i|j|k|l|m|n|o|p|r|s|t|u|f|h|ts|ch|sh|sch|''|"|y|e|yu|ya' $sLatinTable &= '|' & StringUpper($sLatinTable) Local $aCyrrilicTable = StringSplit($sCyrrilicTable, "|") Local $aLatinTable = StringSplit($sLatinTable, "|") Local $sRetString = $sStringToTranslit For $i = 1 To $aCyrrilicTable[0] $sRetString = StringReplace($sRetString, $aCyrrilicTable[$i], $aLatinTable[$i], 0, 1) If StringIsASCII($sRetString) Then ExitLoop Next Return $sRetString EndFunc ;==>_Translit_Proc EndFunc |