11.04.2007, 12:23 | #1 |
Участник
|
Не подскажете, есть ли стандартный кодеюнит, который переводит русские слова(названия), на латиницу.
|
|
11.04.2007, 12:49 | #2 |
Участник
|
FUNCTION Translit PARAM RusText Text 100
VAR TransformArray Text 4 DIM 31;2 i Integer j Integer RETURN EngText Text 100 TransformArray [1,1] := 'А'; TransformArray [1,2] := 'А'; TransformArray [2,1] := 'Б'; TransformArray [2,2] := 'B'; TransformArray [3,1] := 'В'; TransformArray [3,2] := 'V'; TransformArray [4,1] := 'Г'; TransformArray [4,2] := 'G'; TransformArray [5,1] := 'Д'; TransformArray [5,2] := 'D'; TransformArray [6,1] := 'Е'; TransformArray [6,2] := 'E'; TransformArray [7,1] := 'Ж'; TransformArray [7,2] := 'ZH'; TransformArray [8,1] := 'З'; TransformArray [8,2] := 'Z'; TransformArray [9,1] := 'И'; TransformArray [9,2] := 'I'; TransformArray [10,1] := 'К'; TransformArray [10,2] := 'К'; TransformArray [11,1] := 'Л'; TransformArray [11,2] := 'L'; TransformArray [12,1] := 'М'; TransformArray [12,2] := 'M'; TransformArray [13,1] := 'Н'; TransformArray [13,2] := 'N'; TransformArray [14,1] := 'О'; TransformArray [14,2] := 'O'; TransformArray [15,1] := 'П'; TransformArray [15,2] := 'P'; TransformArray [16,1] := 'Р'; TransformArray [16,2] := 'R'; TransformArray [17,1] := 'С'; TransformArray [17,2] := 'S'; TransformArray [18,1] := 'Т'; TransformArray [18,2] := 'T'; TransformArray [19,1] := 'У'; TransformArray [19,2] := 'U'; TransformArray [20,1] := 'Ф'; TransformArray [20,2] := 'F'; TransformArray [21,1] := 'Х'; TransformArray [21,2] := 'KH'; TransformArray [22,1] := 'Ц'; TransformArray [22,2] := 'TS'; TransformArray [23,1] := 'Ч'; TransformArray [23,2] := 'CH'; TransformArray [24,1] := 'Ш'; TransformArray [24,2] := 'SH'; TransformArray [25,1] := 'Щ'; TransformArray [25,2] := 'SHCH'; TransformArray [26,1] := 'Ы'; TransformArray [26,2] := 'Y'; TransformArray [27,1] := 'Э'; TransformArray [27,2] := 'E'; TransformArray [28,1] := 'Ю'; TransformArray [28,2] := 'YU'; TransformArray [29,1] := 'Я'; TransformArray [29,2] := 'YA'; TransformArray [30,1] := 'Й'; TransformArray [30,2] := 'Y'; TransformArray [31,1] := 'Ё'; TransformArray [31,2] := 'YO'; RusText := UPPERCASE(RusText); FOR i := 1 TO STRLEN(RusText) DO BEGIN IF (RusText[i] = 'Ъ') OR (RusText[i] = 'Ь') THEN RusText := DELCHR(RusText, '=', FORMAT(RusText[i])); FOR j := 1 TO 31 DO BEGIN IF TransformArray[j,1] = FORMAT(RusText[i]) THEN EngText := EngText + TransformArray[j,2]; END; IF RusText[i] = ' ' THEN EngText := EngText + ' '; END; |
|