2007-12-12 18:16:54 +01:00
|
|
|
--- src/encodings.c
|
2008-04-23 01:42:57 +02:00
|
|
|
+++ src/encodings.c 2008-04-21 13:09:34.436233193 +0200
|
|
|
|
@@ -106,6 +106,11 @@ static struct directory_entry directory_
|
2007-12-12 18:16:54 +01:00
|
|
|
{ "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 */
|
2008-04-23 01:42:57 +02:00
|
|
|
@@ -205,6 +210,7 @@ static struct charset_entry charset_tabl
|
2007-12-12 18:16:54 +01:00
|
|
|
{ "BIG5HKSCS", "nippon" },
|
|
|
|
{ "EUC-CN", "nippon" },
|
|
|
|
{ "EUC-JP", "nippon" },
|
|
|
|
+ { "GB18030", "nippon" },
|
|
|
|
{ "GBK", "nippon" },
|
|
|
|
#endif /* MULTIBYTE_GROFF */
|
|
|
|
|
2008-04-23 01:42:57 +02:00
|
|
|
@@ -263,6 +269,7 @@ static struct less_charset_entry less_ch
|
2007-12-12 18:16:54 +01:00
|
|
|
{ "UTF-8", "utf-8" },
|
|
|
|
|
|
|
|
#ifdef MULTIBYTE_GROFF
|
|
|
|
+ { "GB18030", "zh" },
|
|
|
|
{ "EUC-JP", "ja" },
|
|
|
|
{ "KOI8-R", "koi8-r" },
|
|
|
|
#endif /* MULTIBYTE_GROFF */
|
2008-04-23 01:42:57 +02:00
|
|
|
@@ -387,6 +394,13 @@ char *get_page_encoding (const char *lan
|
2007-12-12 18:16:54 +01:00
|
|
|
* 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)
|
|
|
|
{
|
2008-04-23 01:42:57 +02:00
|
|
|
@@ -527,7 +541,7 @@ static int compatible_encodings (const c
|
2007-12-12 18:16:54 +01:00
|
|
|
*/
|
|
|
|
if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
|
2008-04-23 01:42:57 +02:00
|
|
|
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")) &&
|
2007-12-12 18:16:54 +01:00
|
|
|
STREQ (output, "UTF-8"))
|
|
|
|
return 1;
|
2008-04-23 01:42:57 +02:00
|
|
|
@@ -606,7 +620,7 @@ const char *get_roff_encoding (const cha
|
2007-12-12 18:16:54 +01:00
|
|
|
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 */
|
|
|
|
|