… | |
… | |
35 | CS_JIS0213_2, |
35 | CS_JIS0213_2, |
36 | |
36 | |
37 | CS_KSC5601_1987_0, |
37 | CS_KSC5601_1987_0, |
38 | |
38 | |
39 | CS_GB2312_1980_0, |
39 | CS_GB2312_1980_0, |
|
|
40 | CS_GBK_0, |
40 | |
41 | |
41 | CS_CNS11643_1992_1, |
42 | CS_CNS11643_1992_1, |
42 | CS_CNS11643_1992_2, |
43 | CS_CNS11643_1992_2, |
43 | CS_CNS11643_1992_3, |
44 | CS_CNS11643_1992_3, |
44 | CS_CNS11643_1992_4, |
45 | CS_CNS11643_1992_4, |
… | |
… | |
66 | REPLACEMENT_CHAR = 0xfffd, |
67 | REPLACEMENT_CHAR = 0xfffd, |
67 | NOCHAR = 65535, // must be invalid in ANY codeset (!) |
68 | NOCHAR = 65535, // must be invalid in ANY codeset (!) |
68 | }; |
69 | }; |
69 | |
70 | |
70 | struct rxvt_codeset_conv { |
71 | struct rxvt_codeset_conv { |
71 | virtual uint32_t from_unicode (unicode_t unicode) const { return unicode; } |
72 | uint32_t (*from_unicode) (unicode_t unicode); |
72 | #if ENCODING_TO_UNICODE |
73 | #if ENCODING_TO_UNICODE |
73 | virtual unicode_t to_unicode (uint32_t enc) const { return enc; } |
74 | unicode_t (*to_unicode) (uint32_t enc); |
74 | #endif |
75 | #endif |
75 | }; |
76 | }; |
76 | |
77 | |
77 | extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS]; |
78 | extern const rxvt_codeset_conv rxvt_codeset[NUM_CODESETS]; |
78 | |
79 | |
79 | extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2); |
80 | extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2); |
80 | |
81 | |
81 | #define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code) |
82 | #define FROM_UNICODE(cs,code) rxvt_codeset[cs].from_unicode (code) |
82 | #define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code) |
83 | #define TO_UNICODE(cs,code) rxvt_codeset[cs].to_unicode (code) |
83 | |
84 | |
84 | struct unicode { // namespace für arme |
85 | struct unicode { // namespace für arme |
85 | static bool is_space (unicode_t c); |
86 | static bool is_space (unicode_t c); |
86 | }; |
87 | }; |
87 | |
88 | |