Преобразование DOS-строки в WIN-строку
(defun ru-conv-oem-to-ansi (str / st)
;|
(ru-conv-oem-to-ansi "‚ з й е оЈ ¦Ё«-Ўл« жЁвагб, ¤ , ® д «миЁўл© нЄ§Ґ¬Ї«па ‚ —Ђ™Ђ• ћѓЂ †?‹-Ѓ›‹ –?’ђ“‘, „Ђ, ЌЋ ”Ђ‹њ??‚›‰ ќЉ‡…ЊЏ‹џђ 1234567890 The quick brown fox jumps over a lazy dog THE QUICK BROWN FOX JUMPS OVER A LAZY DOG")
"В чащах юга жил-был цитрус, да, но фальшивый экземпляр В ЧАЩАХ ЮГА ЖИЛ-БЫЛ ЦИТРУС, ДА, НО ФАЛЬШИВЫЙ ЭКЗЕМПЛЯР 1234567890 The quick brown fox jumps over a lazy dog THE QUICK BROWN FOX JUMPS OVER A LAZY DOG"
"В чащах юга жил-был цитрус, да, но фальшивый экземпляр"
(ru-conv-oem-to-ansi "В чащах юга жил-был цитрус, да, но фальшивый экземпляр")
"’ чрщрх юур цшы-сыы цштрус, фр, эю фрыьшштыщ эъчхьяыяр"
(ru-conv-oem-to-ansi "ru-conv-oem-to-ansi: 1234567890 В чащах юга жил-был цитрус, да, но фальшивый экземпляр")
"ru-conv-oem-to-ansi: 1234567890 ’ чрщрх юур цшы-сыы цштрус, фр, эю фрыьшштыщ эъчхьяыяр"
Строка UNICODE
M+2E2A5M+2E5ADM+2AEABM+2AEA3M+2A8E7M+2A5E1M+2AAAEM+2A3AEffffffM+2E63Fe
|;
(setq st "")
(while (< 0 (strlen str))
(setq
st (strcat st (ru-conv-oem-char (substr str 1 1)))
str (substr str 2)
) ;_ end of setq
) ;_ end of while
st
) ;_ end of defun
(defun ru-conv-oem-char (ch / code)
(setq code (ascii ch))
(chr (+ code
(cond ((<= 128 code 175) 64)
((<= 176 code 223) -48)
((<= 224 code 239) 16)
(t 0)
) ;_ end of cond
) ;_ end of +
) ;_ end of chr
) ;_ end of defun
;|
(defun ru-conv-oem-char (ch / code)
(setq code (ascii ch))
(cond
((<= 128 code 175)
(chr (+ code 64))
)
((<= 176 code 223)
(chr (+ code -48))
)
((<= 224 code 239)
(chr (+ code 16))
)
(t ch)
) ;_ end of cond
) ;_ end of defun
|;
;|«Visual LISP© Format Options»
(80 2 40 2 T "end of " 82 9 1 0 nil nil T nil T)
;*** DO NOT add text below the comment! ***|;