2313
|
1 #ifndef _LIBRCD_H
|
|
2 #define _LIBRCD_H
|
|
3
|
|
4 #ifdef __cplusplus
|
|
5 extern "C" {
|
|
6 #endif
|
|
7
|
|
8 enum rcd_russian_charset_t {
|
|
9 RUSSIAN_CHARSET_WIN = 0,
|
|
10 RUSSIAN_CHARSET_KOI,
|
|
11 RUSSIAN_CHARSET_UTF8,
|
|
12 RUSSIAN_CHARSET_ALT
|
|
13 };
|
|
14 typedef enum rcd_russian_charset_t rcd_russian_charset;
|
|
15
|
|
16
|
|
17 /*
|
|
18 rcdGetRussianCharset
|
|
19 Detects encoding of russian text passed in buf variable. Support
|
|
20 UTF-8, CP1251, CP866 and KOI8-R encoding.
|
|
21
|
|
22 buf String with russian texts
|
|
23 len Number of bytes to use from buf. If zero is passed determined
|
|
24 by strlen.
|
|
25
|
|
26 Returns:
|
|
27 0 - CP1251
|
|
28 1 - KOI8-R
|
|
29 2 - UTF8
|
|
30 3 - CP866
|
|
31 */
|
|
32
|
|
33 rcd_russian_charset rcdGetRussianCharset(const char *buf, int len);
|
|
34
|
|
35 #ifdef __cplusplus
|
|
36 }
|
|
37 #endif
|
|
38
|
|
39 /* Backward compatibility */
|
|
40 #ifndef _LIBRCD_C
|
|
41 # define russian_charsets rcd_russian_charset_t
|
|
42 # define get_russian_charset rcdGetRussianCharset
|
|
43 #endif /* ! _LIBRCD_C */
|
|
44
|
|
45 #endif /* _LIBRCD_H */
|