--- src/encodings.c +++ src/encodings.c 2008-04-21 13:09:34.436233193 +0200 @@ -106,6 +106,11 @@ static struct directory_entry directory_ { "cs", "ISO-8859-2", "ISO-8859-2" }, /* Czech */ { "hr", "ISO-8859-2", "ISO-8859-2" }, /* Croatian */ { "hu", "ISO-8859-2", "ISO-8859-2" }, /* Hungarian */ + { "zh_TW", "BIG5", "BIG5" }, /* Traditional Chinese */ + { "zh_HK", "BIG5HKSCS", "BIG5HKSCS" }, /* Traditional Chinese */ + { "zh_CN", "GB18030", "GB18030" }, /* Simplified Chinese */ + { "zh_SG", "GB18030", "GB18030" }, /* Simplified Chinese */ + { "zh", "GB18030", "GB18030" }, /* Simplified Chinese */ { "ja", "EUC-JP", "EUC-JP" }, /* Japanese */ { "ko", "EUC-KR", "EUC-KR" }, /* Korean */ { "pl", "ISO-8859-2", "ISO-8859-2" }, /* Polish */ @@ -205,6 +210,7 @@ static struct charset_entry charset_tabl { "BIG5HKSCS", "nippon" }, { "EUC-CN", "nippon" }, { "EUC-JP", "nippon" }, + { "GB18030", "nippon" }, { "GBK", "nippon" }, #endif /* MULTIBYTE_GROFF */ @@ -263,6 +269,7 @@ static struct less_charset_entry less_ch { "UTF-8", "utf-8" }, #ifdef MULTIBYTE_GROFF + { "GB18030", "zh" }, { "EUC-JP", "ja" }, { "KOI8-R", "koi8-r" }, #endif /* MULTIBYTE_GROFF */ @@ -387,6 +394,13 @@ char *get_page_encoding (const char *lan * roff encoding = UTF-8 * output encoding = UTF-8 * EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8 + * + * /usr/share/man/zh_CN.GB18030, locale zh_CN.UTF-8 + * page encoding = GB18030 + * source encoding = GB18030 + * roff encoding = UTF-8 + * output encoding = UTF-8 + * GB18030 -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8 */ const char *get_source_encoding (const char *lang) { @@ -527,7 +541,7 @@ static int compatible_encodings (const c */ if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") || STREQ (input, "EUC-JP") || - STREQ (input, "EUC-CN") || STREQ (input, "GBK") || + STREQ (input, "EUC-CN") || STREQ (input, "GB18030") || STREQ (input, "GBK") STREQ (input, "EUC-KR")) && STREQ (output, "UTF-8")) return 1; @@ -606,7 +620,7 @@ const char *get_roff_encoding (const cha STREQ (ctype, "zh_HK.UTF-8") || STREQ (ctype, "zh_SG.UTF-8") || STREQ (ctype, "zh_TW.UTF-8")) - roff_encoding = "UTF-8"; + roff_encoding = source_encoding; /* "UTF-8"; */ } #endif /* MULTIBYTE_GROFF */