--- rxvt-unicode/src/encoding.h 2003/11/24 17:28:08 1.1 +++ rxvt-unicode/src/encoding.h 2004/08/04 03:29:28 1.13 @@ -1,11 +1,13 @@ #ifndef ENCODING_H #define ENCODING_H -#include +#include +typedef uint32_t unicode_t; + +// order must match the table in encoding.C(!) enum codeset { CS_UNKNOWN = 0, - CS_SPECIAL, CS_US_ASCII, CS_ISO8859_1, @@ -27,9 +29,8 @@ CS_KOI8_R, CS_KOI8_U, CS_JIS0201_1976_0, - CS_JIS0208_1983_0, + CS_JIS0208_1990_0, CS_JIS0212_1990_0, - CS_JIS0213_1, CS_JIS0213_2, @@ -46,6 +47,7 @@ CS_CNS11643_1992_7, CS_CNS11643_1992_F, + CS_BIG5, CS_BIG5_EXT, CS_BIG5_PLUS, @@ -61,18 +63,27 @@ enum { ZERO_WIDTH_CHAR = 0x200b, - NOCHAR = 65535, // must be invalid in ANY codeset(!) + REPLACEMENT_CHAR = 0xfffd, + NOCHAR = 65535, // must be invalid in ANY codeset (!) }; struct rxvt_codeset_conv { - virtual uint32_t from_unicode (uint32_t unicode) const { return unicode; } - virtual uint32_t to_unicode (uint32_t enc) const { return enc; } + uint32_t (*from_unicode) (unicode_t unicode); +#if ENCODING_TO_UNICODE + unicode_t (*to_unicode) (uint32_t enc); +#endif }; -extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS]; +extern const rxvt_codeset_conv rxvt_codeset[NUM_CODESETS]; -#define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code) -#define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code) +extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2); + +#define FROM_UNICODE(cs,code) rxvt_codeset[cs].from_unicode (code) +#define TO_UNICODE(cs,code) rxvt_codeset[cs].to_unicode (code) + +struct unicode { // namespace für arme + static bool is_space (unicode_t c); +}; #endif