Added msxml3_encode_gb2312 patchset

This commit is contained in:
Alistair Leslie-Hughes
2025-09-11 09:48:29 +10:00
parent e33772ec34
commit 3d1b6a4bc0
2 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
From 2e2e981c7b2c2e109730a646cda6f12ca7428927 Mon Sep 17 00:00:00 2001
From: Jactry Zeng <jzeng@codeweavers.com>
Date: Fri, 22 Sep 2023 09:13:29 -0500
Subject: [PATCH] msxml3: Add GB2312 support for builtin character converter.
---
dlls/msxml3/main.c | 1 +
dlls/msxml3/tests/domdoc.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/dlls/msxml3/main.c b/dlls/msxml3/main.c
index 16e0b38b185..b0711c510f6 100644
--- a/dlls/msxml3/main.c
+++ b/dlls/msxml3/main.c
@@ -321,6 +321,7 @@ static void init_char_encoders(void)
xmlCharEncodingOutputFunc output;
} encoder[] =
{
+ { "gb2312", gbk_to_utf8, utf8_to_gbk },
{ "gbk", gbk_to_utf8, utf8_to_gbk },
{ "iso8859-1", iso8859_1_to_utf8, utf8_to_iso8859_1 },
{ "windows-1250", win1250_to_utf8, utf8_to_win1250 },
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 84a1f330582..44ea0ac3b3a 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -798,6 +798,13 @@ static const char win936xml[] =
DECL_WIN_936
"<open></open>";
+#define DECL_WIN_GB2312 \
+"<?xml version=\"1.0\" encoding=\"GB2312\"?>"
+
+static const char gb2312xml[] =
+DECL_WIN_GB2312
+"<open></open>";
+
#define DECL_WIN_1252 \
"<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
@@ -10981,6 +10988,7 @@ static void test_load(void)
{ iso8859_1_xml, S_OK, VARIANT_TRUE },
{ win1252xml, S_OK, VARIANT_TRUE },
{ win936xml, S_FALSE, VARIANT_FALSE },
+ { gb2312xml, S_OK, VARIANT_TRUE },
};
--
2.51.0

View File

@@ -0,0 +1,6 @@
Fixes: [58673] msxml: Add GB2312 support for builtin character converter.
# PR https://gitlab.winehq.org/wine/wine/-/merge_requests/3928