1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

html: Only map HTML encodings from meta tag

This commit is contained in:
Nick Wellnhofer
2025-05-12 21:21:25 +02:00
parent 19b9931184
commit cdce17c3cb

View File

@@ -1229,14 +1229,11 @@ xmlSwitchInputEncodingName(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
const char *encoding) {
xmlCharEncodingHandlerPtr handler;
xmlParserErrors res;
xmlCharEncFlags flags = XML_ENC_INPUT;
if (encoding == NULL)
return(-1);
if (ctxt->html)
flags |= XML_ENC_HTML;
res = xmlCreateCharEncodingHandler(encoding, flags,
res = xmlCreateCharEncodingHandler(encoding, XML_ENC_INPUT,
ctxt->convImpl, ctxt->convCtxt, &handler);
if (res == XML_ERR_UNSUPPORTED_ENCODING) {
xmlWarningMsg(ctxt, XML_ERR_UNSUPPORTED_ENCODING,