From: Bernhard Übelacker bernhardu@mailbox.org
This fixes eFilmLt.exe when running with builtin msxml6.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55804 --- dlls/msxml3/main.c | 31 +++++++++++++++++++++---------- dlls/msxml3/tests/domdoc.c | 22 +++++++++++++++++++--- 2 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/dlls/msxml3/main.c b/dlls/msxml3/main.c index 5e8de1676cf..b329420eb66 100644 --- a/dlls/msxml3/main.c +++ b/dlls/msxml3/main.c @@ -212,6 +212,16 @@ static int utf8_to_gbk(unsigned char *out, int *outlen, const unsigned char *in, return from_utf8(936, out, outlen, in, inlen); }
+static int iso8859_1_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(28591, out, outlen, in, inlen); +} + +static int utf8_to_iso8859_1(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(28591, out, outlen, in, inlen); +} + static int win1250_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) { return to_utf8(1250, out, outlen, in, inlen); @@ -310,16 +320,17 @@ static void init_char_encoders(void) xmlCharEncodingOutputFunc output; } encoder[] = { - { "gbk", gbk_to_utf8, utf8_to_gbk }, - { "windows-1250", win1250_to_utf8, utf8_to_win1250 }, - { "windows-1251", win1251_to_utf8, utf8_to_win1251 }, - { "windows-1252", win1252_to_utf8, utf8_to_win1252 }, - { "windows-1253", win1253_to_utf8, utf8_to_win1253 }, - { "windows-1254", win1254_to_utf8, utf8_to_win1254 }, - { "windows-1255", win1255_to_utf8, utf8_to_win1255 }, - { "windows-1256", win1256_to_utf8, utf8_to_win1256 }, - { "windows-1257", win1257_to_utf8, utf8_to_win1257 }, - { "windows-1258", win1258_to_utf8, utf8_to_win1258 } + { "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 }, + { "windows-1251", win1251_to_utf8, utf8_to_win1251 }, + { "windows-1252", win1252_to_utf8, utf8_to_win1252 }, + { "windows-1253", win1253_to_utf8, utf8_to_win1253 }, + { "windows-1254", win1254_to_utf8, utf8_to_win1254 }, + { "windows-1255", win1255_to_utf8, utf8_to_win1255 }, + { "windows-1256", win1256_to_utf8, utf8_to_win1256 }, + { "windows-1257", win1257_to_utf8, utf8_to_win1257 }, + { "windows-1258", win1258_to_utf8, utf8_to_win1258 } }; int i;
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index ce2e7e655eb..10be50656d5 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -784,6 +784,13 @@ static const char gbkxml[] = DECL_GBK "<open></open>";
+#define DECL_ISO8859_1 \ +"<?xml version=\"1.0\" encoding=\"ISO8859-1\"?>" + +static const char iso8859_1_xml[] = +DECL_ISO8859_1 +"<open></open>"; + #define DECL_WIN_936 \ "<?xml version=\"1.0\" encoding=\"Windows-936\"?>"
@@ -1609,6 +1616,14 @@ if (0) ok( b == VARIANT_FALSE, "succeeded in loading XML string\n"); SysFreeString( str );
+ /* try a BSTR containing a ISO8859-1 document */ + b = VARIANT_TRUE; + str = SysAllocStringByteLen( iso8859_1_xml, strlen(iso8859_1_xml) ); + hr = IXMLDOMDocument_loadXML( doc, str, &b ); + ok(hr == S_FALSE, "loadXML succeeded\n"); + ok( b == VARIANT_FALSE, "succeeded in loading XML string\n"); + SysFreeString( str ); + /* try to load something valid */ b = VARIANT_FALSE; str = SysAllocString( szComplete1 ); @@ -10838,9 +10853,10 @@ static void test_load(void) VARIANT_BOOL expected_ret; } encoding_tests[] = { - { gbkxml, S_OK, VARIANT_TRUE }, - { win1252xml, S_OK, VARIANT_TRUE }, - { win936xml, S_FALSE, VARIANT_FALSE }, + { gbkxml, S_OK, VARIANT_TRUE }, + { iso8859_1_xml, S_OK, VARIANT_TRUE }, + { win1252xml, S_OK, VARIANT_TRUE }, + { win936xml, S_FALSE, VARIANT_FALSE }, };