From 88cc2d114a1c393e17cd6175ec805a5f14a194ca Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Thu, 9 Nov 2017 21:17:49 +0800 Subject: [PATCH] mlang: Add more Chinese code pages support. Signed-off-by: Ziqing Hui Signed-off-by: Alexandre Julliard --- dlls/mlang/mlang.c | 36 ++++++++++++++++++++++++++++++++---- dlls/mlang/tests/mlang.c | 6 ------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index 9c76c11feb8..47f9d9882ff 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -118,13 +118,33 @@ static const MIME_CP_INFO baltic_cp[] = }; static const MIME_CP_INFO chinese_simplified_cp[] = { + { "Chinese Simplified (Auto-Select)", + 50936, MIMECONTF_IMPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + "_autodetect_chs", "_autodetect_chs", "_autodetect_chs" }, { "Chinese Simplified (GB2312)", 936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | - MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_VALID | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, "gb2312", "gb2312", "gb2312" }, - { "Chinese Simplified (GBK)", + { "Chinese Simplified (GB2312-80)", + 20936, MIMECONTF_IMPORT | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + "x-cp20936", "x-cp20936", "x-cp20936" }, + { "Chinese Simplified (HZ)", + 52936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | + MIMECONTF_VALID | MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | + MIMECONTF_MIME_LATEST, + "hz-gb-2312", "hz-gb-2312", "hz-gb-2312" }, + { "Chinese Simplified (GB18030)", + 54936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | + MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | + MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + "GB18030", "GB18030", "GB18030" }, + { "Chinese Simplified (GBK)", 936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID_NLS | @@ -133,12 +153,20 @@ static const MIME_CP_INFO chinese_simplified_cp[] = }; static const MIME_CP_INFO chinese_traditional_cp[] = { + { "Chinese Traditional (Auto-Select)", + 50950, MIMECONTF_IMPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + "_autodetect_cht", "_autodetect_cht", "_autodetect_cht" }, { "Chinese Traditional (Big5)", 950, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | - MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, - "big5", "big5", "big5" } + "big5", "big5", "big5" }, + { "Chinese Traditional (CNS)", + 20000, MIMECONTF_IMPORT | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + "x-Chinese-CNS", "x-Chinese-CNS", "x-Chinese-CNS" } }; static const MIME_CP_INFO central_european_cp[] = { diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index ffa422cca66..141af397801 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -254,7 +254,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'S','i','m','s','u','n',0}, {'S','i','m','s','u','n',0}, 134 }, - TRUE }, /* 1. Chinese Simplified (GB2312) */ { @@ -282,7 +281,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'S','i','m','s','u','n',0}, {'S','i','m','s','u','n',0}, 134 }, - TRUE }, /* 3. Chinese Simplified (HZ) */ { @@ -297,7 +295,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'S','i','m','s','u','n',0}, {'S','i','m','s','u','n',0}, 134 }, - TRUE }, /* 4. Chinese Simplified (GB18030) */ { @@ -312,7 +309,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'S','i','m','s','u','n',0}, {'S','i','m','s','u','n',0}, 134 }, - TRUE }, /* 5. Chinese Traditional (Auto-Select) */ { @@ -325,7 +321,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'M','i','n','g','L','i','u',0}, {'N','e','w',' ','M','i','n','g','L','i','u',0}, 136 }, - TRUE }, /* 6. Chinese Traditional (Big5) */ { @@ -353,7 +348,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'M','i','n','g','L','i','u',0}, {'N','e','w',' ','M','i','n','g','L','i','u',0}, 136 }, - TRUE } };