63 lines
2.4 KiB
Plaintext
63 lines
2.4 KiB
Plaintext
--- src/encodings.c
|
|
+++ src/encodings.c 2008-08-12 15:26:22.959763175 +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 */
|
|
@@ -208,6 +213,7 @@ static struct charset_entry charset_tabl
|
|
{ "EUC-CN", "nippon" },
|
|
{ "EUC-JP", "nippon" },
|
|
{ "EUC-TW", "nippon" },
|
|
+ { "GB18030", "nippon" },
|
|
{ "GBK", "nippon" },
|
|
#endif /* MULTIBYTE_GROFF */
|
|
|
|
@@ -281,6 +287,7 @@ static struct less_charset_entry less_ch
|
|
{ "UTF-8", "utf-8", NULL },
|
|
|
|
#ifdef MULTIBYTE_GROFF
|
|
+ { "GB18030", "zh", NULL },
|
|
{ "EUC-JP", "iso8859", "japanese-ujis" },
|
|
{ "KOI8-R", "koi8-r", NULL },
|
|
#endif /* MULTIBYTE_GROFF */
|
|
@@ -405,6 +412,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)
|
|
{
|
|
@@ -545,7 +559,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 (input, "EUC-TW")) &&
|
|
STREQ (output, "UTF-8"))
|
|
@@ -639,7 +653,7 @@ const char *get_roff_encoding (const cha
|
|
STRNEQ (ctype, "zh_HK", 5) ||
|
|
STRNEQ (ctype, "zh_SG", 5) ||
|
|
STRNEQ (ctype, "zh_TW", 5))
|
|
- roff_encoding = "UTF-8";
|
|
+ roff_encoding = source_encoding; /* "UTF-8"; */
|
|
}
|
|
#endif /* MULTIBYTE_GROFF */
|
|
|