mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-28 22:50:07 +03:00
parser: Never use UTF-8 encoding handler
This commit is contained in:
parent
507f11edf0
commit
61b8e097b9
@ -1386,6 +1386,15 @@ xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
||||
input->flags |= XML_INPUT_HAS_ENCODING;
|
||||
input->flags &= ~XML_INPUT_8_BIT;
|
||||
|
||||
/*
|
||||
* UTF-8 requires no encoding handler.
|
||||
*/
|
||||
if ((handler != NULL) &&
|
||||
(xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
|
||||
xmlCharEncCloseFunc(handler);
|
||||
handler = NULL;
|
||||
}
|
||||
|
||||
if (in->encoder == handler)
|
||||
return (0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user