mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
parser: Remove xmlErrEncoding
Use xmlFatalErr or xmlCtxtErrIO.
This commit is contained in:
15
HTMLparser.c
15
HTMLparser.c
@@ -490,20 +490,7 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
|
||||
}
|
||||
|
||||
encoding_error:
|
||||
{
|
||||
char buffer[150];
|
||||
|
||||
if (ctxt->input->end - ctxt->input->cur >= 4) {
|
||||
snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
|
||||
ctxt->input->cur[0], ctxt->input->cur[1],
|
||||
ctxt->input->cur[2], ctxt->input->cur[3]);
|
||||
} else {
|
||||
snprintf(buffer, 149, "Bytes: 0x%02X\n", ctxt->input->cur[0]);
|
||||
}
|
||||
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
|
||||
"Input is not proper UTF-8, indicate encoding !\n",
|
||||
BAD_CAST buffer, NULL);
|
||||
}
|
||||
xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
|
||||
|
||||
if ((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0)
|
||||
xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
|
||||
|
||||
Reference in New Issue
Block a user