/rusxmms/librcc

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcc

« back to all changes in this revision

Viewing changes to example/example.c

  • Committer: Suren A. Chilingaryan
  • Date: 2005-06-16 23:14:30 UTC
  • Revision ID: Arch-1:ds@dside.dyndns.org--darksoft-2004%librcc--main--0.1--base-0
Initial Import

Show diffs side-by-side

added added

removed removed

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