Subject: Re: cyrillic conversion programs
From: vladimir@silver-vly.cs.ualberta.ca (Vladimir Alexiev)
In article <1735E1B79S86.AS1536A@american.edu> AS1536A@american.edu (Amy L. Stiefel) writes:
> Is there any software available to convert cyrillic characrters into latin char
> acters?
First of all, you should realize that there are quite a lot of cyrillic
encoding standards, and even more ways to transliterate cyrillic letters to
latin alphabet. Take a look at
Cyrillisation of
software for some info. Below is a simple C source to transliterate from
the most common PC encoding (cyrillic uppercase at ascii 128-160 and
lowercase at 160-192) to latin letters delimited with /+ and /-
(example: "this here is latin /+a tova e kirilica/-").
/* frompc.c */
#define ESC '/' /* the escape char */
#include
#include
#include
char xlat[64+1]="\
ABWGDEVZIJKLMNOPRSTUFHC~{}Y@X@|Q\
abwgdevzijklmnoprstufhc`[]y@x@\\q";
void main(void)
{
int cyr=0; /* cyr mode on */
int c;
while ((c=getch())!=EOF) {
if (c<128) {
if (cyr && strchr(xlat,c)) { putch(ESC); putch('-'); cyr=0; }
putch(c);
} else {
if (!cyr) { putch(ESC); putch('+'); cyr=1; }
putch(xlat[c-128]);
}
}
}