From 0ba951021a6e4e9fbc60d07cd8b1f0a8fd6ae61e Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Sun, 20 Jan 2013 12:58:03 +0100 Subject: [PATCH] Elinks currently only support GB2312 as Chinese encoding, but GBK and GB18030 are also widely used. Codepage CP936 is almost identical to GBK, so I add it as an alias. --- src/intl/codepage.inc | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/intl/codepage.inc b/src/intl/codepage.inc index 6fe368a6..dfc63788 100644 --- a/src/intl/codepage.inc +++ b/src/intl/codepage.inc @@ -4935,11 +4935,34 @@ unsigned char *const aliases_euc_tw [] = { NULL }; +/*** GBK ***/ + +unsigned char *const aliases_gbk [] = { + "gbk", + "936", + "cp936", + "windows936", + "windows-936", + NULL +}; + /*** GB2312 ***/ unsigned char *const aliases_gb2312 [] = { "gb2312", "gb-2312", + "gb_2312", + "gb 2312", + NULL +}; + +/*** GB18030 ***/ + +unsigned char *const aliases_gb18030 [] = { + "gb18030", + "gb-18030", + "gb_18030", + "gb 18030", NULL }; @@ -5021,9 +5044,11 @@ const struct codepage_desc codepages [] = { {"EUC-JP", aliases_euc_jp, highhalf_NULL, table_NULL, 1}, {"EUC-KR", aliases_euc_kr, highhalf_NULL, table_NULL, 1}, {"EUC-TW", aliases_euc_tw, highhalf_NULL, table_NULL, 1}, + {"GBK", aliases_gbk, highhalf_NULL, table_NULL, 1}, {"GB2312", aliases_gb2312, highhalf_NULL, table_NULL, 1}, + {"GB18030", aliases_gb18030, highhalf_NULL, table_NULL, 1}, {"ISO-2022-JP", aliases_iso2022jp, highhalf_NULL, table_NULL, 1}, {NULL, NULL, NULL, 0} }; -#define N_CODEPAGES 43 +#define N_CODEPAGES 45