1 | #ifndef ENCODING_H |
1 | #ifndef ENCODING_H |
2 | #define ENCODING_H |
2 | #define ENCODING_H |
3 | |
3 | |
4 | #include <stdint.h> |
4 | #include <stdint.h> |
5 | |
5 | |
|
|
6 | // order must match the table in encoding.C(!) |
6 | enum codeset { |
7 | enum codeset { |
7 | CS_UNKNOWN = 0, |
8 | CS_UNKNOWN = 0, |
8 | CS_SPECIAL, |
9 | CS_SPECIAL, |
9 | CS_US_ASCII, |
10 | CS_US_ASCII, |
10 | |
11 | |
… | |
… | |
44 | CS_CNS11643_1992_5, |
45 | CS_CNS11643_1992_5, |
45 | CS_CNS11643_1992_6, |
46 | CS_CNS11643_1992_6, |
46 | CS_CNS11643_1992_7, |
47 | CS_CNS11643_1992_7, |
47 | CS_CNS11643_1992_F, |
48 | CS_CNS11643_1992_F, |
48 | |
49 | |
|
|
50 | CS_BIG5, |
49 | CS_BIG5_EXT, |
51 | CS_BIG5_EXT, |
50 | CS_BIG5_PLUS, |
52 | CS_BIG5_PLUS, |
51 | |
53 | |
52 | CS_VISCII, |
54 | CS_VISCII, |
53 | |
55 | |
… | |
… | |
59 | |
61 | |
60 | codeset codeset_from_name (const char *name); |
62 | codeset codeset_from_name (const char *name); |
61 | |
63 | |
62 | enum { |
64 | enum { |
63 | ZERO_WIDTH_CHAR = 0x200b, |
65 | ZERO_WIDTH_CHAR = 0x200b, |
64 | NOCHAR = 65535, // must be invalid in ANY codeset(!) |
66 | NOCHAR = 65535, // must be invalid in ANY codeset (!) |
65 | }; |
67 | }; |
66 | |
68 | |
67 | struct rxvt_codeset_conv { |
69 | struct rxvt_codeset_conv { |
68 | virtual uint32_t from_unicode (uint32_t unicode) const { return unicode; } |
70 | virtual uint32_t from_unicode (uint32_t unicode) const { return unicode; } |
69 | virtual uint32_t to_unicode (uint32_t enc) const { return enc; } |
71 | virtual uint32_t to_unicode (uint32_t enc) const { return enc; } |