ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/encoding.h
Revision: 1.3
Committed: Wed Mar 3 00:20:33 2004 UTC (20 years, 3 months ago) by pcg
Content type: text/plain
Branch: MAIN
CVS Tags: rel-2_1_0
Changes since 1.2: +2 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1 #ifndef ENCODING_H
2     #define ENCODING_H
3    
4     #include <stdint.h>
5    
6 pcg 1.3 // order must match the table in encoding.C(!)
7 pcg 1.1 enum codeset {
8     CS_UNKNOWN = 0,
9     CS_SPECIAL,
10     CS_US_ASCII,
11    
12     CS_ISO8859_1,
13     CS_ISO8859_2,
14     CS_ISO8859_3,
15     CS_ISO8859_4,
16     CS_ISO8859_5,
17     CS_ISO8859_6,
18     CS_ISO8859_7,
19     CS_ISO8859_8,
20     CS_ISO8859_9,
21     CS_ISO8859_10,
22     CS_ISO8859_11,
23     CS_ISO8859_13,
24     CS_ISO8859_14,
25     CS_ISO8859_15,
26     CS_ISO8859_16,
27    
28     CS_KOI8_R,
29     CS_KOI8_U,
30     CS_JIS0201_1976_0,
31     CS_JIS0208_1983_0,
32     CS_JIS0212_1990_0,
33    
34     CS_JIS0213_1,
35     CS_JIS0213_2,
36    
37     CS_KSC5601_1987_0,
38    
39     CS_GB2312_1980_0,
40    
41     CS_CNS11643_1992_1,
42     CS_CNS11643_1992_2,
43     CS_CNS11643_1992_3,
44     CS_CNS11643_1992_4,
45     CS_CNS11643_1992_5,
46     CS_CNS11643_1992_6,
47     CS_CNS11643_1992_7,
48     CS_CNS11643_1992_F,
49    
50 pcg 1.3 CS_BIG5,
51 pcg 1.1 CS_BIG5_EXT,
52     CS_BIG5_PLUS,
53    
54     CS_VISCII,
55    
56     CS_UNICODE_16, /* 16-bit subset of unicode, for X11 */
57     CS_UNICODE,
58    
59     NUM_CODESETS
60     };
61    
62     codeset codeset_from_name (const char *name);
63    
64     enum {
65     ZERO_WIDTH_CHAR = 0x200b,
66 pcg 1.2 NOCHAR = 65535, // must be invalid in ANY codeset (!)
67 pcg 1.1 };
68    
69     struct rxvt_codeset_conv {
70     virtual uint32_t from_unicode (uint32_t unicode) const { return unicode; }
71     virtual uint32_t to_unicode (uint32_t enc) const { return enc; }
72     };
73    
74     extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS];
75    
76     #define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code)
77     #define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code)
78    
79     #endif
80