man/man-db-2.5.0-chinese.dif

65 lines
2.4 KiB
Plaintext
Raw Normal View History

--- src/encodings.c
+++ src/encodings.c 2007-12-07 19:12:54.428222452 +0100
@@ -110,6 +110,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 */
@@ -209,6 +214,7 @@ static struct charset_entry charset_tabl
{ "BIG5HKSCS", "nippon" },
{ "EUC-CN", "nippon" },
{ "EUC-JP", "nippon" },
+ { "GB18030", "nippon" },
{ "GBK", "nippon" },
#endif /* MULTIBYTE_GROFF */
@@ -267,6 +273,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 */
@@ -391,6 +398,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)
{
@@ -524,8 +538,8 @@ static int compatible_encodings (const c
* rather filthy.
*/
if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
- STREQ (input, "EUC-JP") ||
- STREQ (input, "EUC-CN") || STREQ (input, "GBK")) &&
+ STREQ (input, "EUC-JP") || STREQ (input, "EUC-CN") ||
+ STREQ (input, "GB18030") || STREQ (input, "GBK")) &&
STREQ (output, "UTF-8"))
return 1;
#endif /* MULTIBYTE_GROFF */
@@ -600,7 +614,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 */