/* * _codecs_cn.c: Codecs collection for Mainland Chinese encodings * * Written by Hye-Shik Chang <[email protected]> */ #include "cjkcodecs.h" #include "mappings_cn.h" /** * hz is predefined as 100 on AIX. So we undefine it to avoid * conflict against hz codec's. */ #ifdef _AIX #undef hz #endif /* GBK and GB2312 map differently in few code points that are listed below: * * gb2312 gbk * A1A4 U+30FB KATAKANA MIDDLE DOT U+00B7 MIDDLE DOT * A1AA U+2015 HORIZONTAL BAR U+2014 EM DASH * A844 undefined U+2015 HORIZONTAL BAR */ #define GBK_DECODE(dc1, dc2, writer) … #define GBK_ENCODE(code, assi) … /* * codecs in this file use the first byte of MultibyteCodec_State.c[8] * to store a 0 or 1 state value */ #define CN_STATE_OFFSET … /* * GB2312 codec */ ENCODER(gb2312) { … } DECODER(gb2312) { … } /* * GBK codec */ ENCODER(gbk) { … } DECODER(gbk) { … } /* * GB18030 codec */ ENCODER(gb18030) { … } DECODER(gb18030) { … } /* * HZ codec */ ENCODER_INIT(hz) { … } ENCODER_RESET(hz) { … } ENCODER(hz) { … } DECODER_INIT(hz) { … } DECODER_RESET(hz) { … } DECODER(hz) { … } BEGIN_MAPPINGS_LIST(…) BEGIN_CODECS_LIST(…) I_AM_A_MODULE_FOR(cn)