2 * make KOI8->CP866(ALT) and CP866(ALT)->KOI8 translation table
22 for (i
= 0; i
< 128; i
++)
23 koitab
[i
] = alttab
[i
] = 0;
25 while (fgets(buf
, sizeof(buf
), stdin
) != NULL
)
29 sscanf(buf
, "%d %d", &koi
, &alt
);
30 if (koi
< 128 || koi
> 255 || alt
< 128 || alt
> 255)
32 fprintf(stderr
, "invalid value %d\n", koi
);
35 koitab
[koi
- 128] = alt
;
36 alttab
[alt
- 128] = koi
;
40 printf("static char koi2alt[] = {\n");
47 printf("0x%02x", koitab
[i
++]);
58 printf("static char alt2koi[] = {\n");
65 printf("0x%02x", alttab
[i
++]);