1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

encoding: Restore old lookup order in xmlOpenCharEncodingHandler

When looking up encodings with xmlLookupCharEncodingHandler, the
returned handler can have a different name than requested
(capitalization, internal aliases). This should eventually be fixed.
For now we revert part of commit 5b893fa9, start the lookup with
xmlFindHandler and add an explicit check for UTF-8.

Should fix the encoding name issue mentioned in #749.
This commit is contained in:
Nick Wellnhofer
2024-06-27 12:00:45 +02:00
parent e6f25fdc7c
commit b1a416bf52
2 changed files with 22 additions and 17 deletions

View File

@@ -50,7 +50,8 @@ testUnsupportedEncoding(void) {
xmlFreeDoc(doc);
error = xmlGetLastError();
if (error->code != XML_ERR_UNSUPPORTED_ENCODING ||
if (error == NULL ||
error->code != XML_ERR_UNSUPPORTED_ENCODING ||
error->level != XML_ERR_WARNING ||
strcmp(error->message, "Unsupported encoding: #unsupported\n") != 0)
{