--- rxvt-unicode/src/encoding.h 2004/03/15 01:27:46 1.11 +++ rxvt-unicode/src/encoding.h 2008/11/05 14:43:54 1.17 @@ -1,7 +1,7 @@ #ifndef ENCODING_H #define ENCODING_H -#include +#include typedef uint32_t unicode_t; @@ -37,6 +37,7 @@ CS_KSC5601_1987_0, CS_GB2312_1980_0, + CS_GBK_0, CS_CNS11643_1992_1, CS_CNS11643_1992_2, @@ -62,26 +63,28 @@ codeset codeset_from_name (const char *name); enum { - ZERO_WIDTH_CHAR = 0x200b, + ZERO_WIDTH_CHAR = 0x200b, REPLACEMENT_CHAR = 0xfffd, - NOCHAR = 65535, // must be invalid in ANY codeset (!) + NOCHAR = 0xffff, // must be invalid in ANY codeset (!) }; -struct rxvt_codeset_conv { - virtual uint32_t from_unicode (unicode_t unicode) const { return unicode; } +struct rxvt_codeset_conv +{ + uint32_t (*from_unicode) (unicode_t unicode); #if ENCODING_TO_UNICODE - virtual unicode_t to_unicode (uint32_t enc) const { return enc; } + 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]; 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) +#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 +struct unicode // namespace für arme +{ static bool is_space (unicode_t c); };