blob: 71f269b34dfaf2d6ec055e36017b396b96a0d8bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdio.h>
#include <string.h>
#include <librcd.h>
main() {
rcd_russian_charset res;
char buf[255];
int l;
while (fgets(buf,255,stdin)) {
if (strlen(buf)<2) break;
res = rcdGetRussianCharset(buf,0);
switch(res) {
case RUSSIAN_CHARSET_WIN:
printf("CP1251: ");
break;
case RUSSIAN_CHARSET_ALT:
printf("CP866 : ");
break;
case RUSSIAN_CHARSET_KOI:
printf("KOI8-R: ");
break;
case RUSSIAN_CHARSET_UTF8:
printf("UTF8 : ");
break;
}
printf("%s",buf);
if (buf[strlen(buf)-1]!='\n') printf("\n");
}
}
|