2 * make KOI8->CP1251(win-1251) and CP1251(win-1251)->KOI8 translation table
7 * src/backend/utils/mb/win1251.c
22 for (i
= 0; i
< 128; i
++)
23 koitab
[i
] = wintab
[i
] = 0;
25 while (fgets(buf
, sizeof(buf
), stdin
) != NULL
)
29 sscanf(buf
, "%d %d", &koi
, &win
);
30 if (koi
< 128 || koi
> 255 || win
< 128 || win
> 255)
32 fprintf(stderr
, "invalid value %d\n", koi
);
35 koitab
[koi
- 128] = win
;
36 wintab
[win
- 128] = koi
;
40 printf("static char koi2win[] = {\n");
47 printf("0x%02x", koitab
[i
++]);
58 printf("static char win2koi[] = {\n");
65 printf("0x%02x", wintab
[i
++]);