summaryrefslogtreecommitdiffstats
path: root/engines/russian.c
blob: f7e51462d65cd07b1ee6ee485d9dd4dc57a80545 (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
#include <stdio.h>

#include <librcd.h>
#include <librcc.h>

static rcc_charset_id AutoengineRussian(rcc_engine_context ctx, const char *buf, int len) {
    return (rcc_charset_id)rcdGetRussianCharset(buf,len);
}

static rcc_engine russian_engine = {
    "Russian", NULL, NULL, &AutoengineRussian, {"CP1251","KOI8-R","UTF-8","IBM866", NULL}
};

static rcc_engine ukrainian_engine = {
    "Russian", NULL, NULL, &AutoengineRussian, {"CP1251","KOI8-U","UTF-8","IBM865", NULL}
};

rcc_engine *rccGetInfo(const char *lang) {
    if (!lang) return NULL;
    
    if (!strcmp(lang, "ru")) return &russian_engine;
    if (!strcmp(lang, "uk")) return &ukrainian_engine;
    
    return NULL;
}