mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
fix #348252 if the document clains to be in a different encoding in the
* HTMLparser.c: fix #348252 if the document clains to be in a different encoding in the meta tag and it's obviously wrong, don't screw up the end of the content. Daniel
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Mon Oct 16 15:14:53 CEST 2006 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* HTMLparser.c: fix #348252 if the document clains to be in a
|
||||||
|
different encoding in the meta tag and it's obviously wrong,
|
||||||
|
don't screw up the end of the content.
|
||||||
|
|
||||||
Mon Oct 16 11:32:09 CEST 2006 Daniel Veillard <daniel@veillard.com>
|
Mon Oct 16 11:32:09 CEST 2006 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* HTMLparser.c: fix a chunking and script bug #347708
|
* HTMLparser.c: fix a chunking and script bug #347708
|
||||||
|
11
HTMLparser.c
11
HTMLparser.c
@ -3291,7 +3291,18 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) {
|
|||||||
* registered set of known encodings
|
* registered set of known encodings
|
||||||
*/
|
*/
|
||||||
if (enc != XML_CHAR_ENCODING_ERROR) {
|
if (enc != XML_CHAR_ENCODING_ERROR) {
|
||||||
|
if (((enc == XML_CHAR_ENCODING_UTF16LE) ||
|
||||||
|
(enc == XML_CHAR_ENCODING_UTF16BE) ||
|
||||||
|
(enc == XML_CHAR_ENCODING_UCS4LE) ||
|
||||||
|
(enc == XML_CHAR_ENCODING_UCS4BE)) &&
|
||||||
|
(ctxt->input->buf != NULL) &&
|
||||||
|
(ctxt->input->buf->encoder == NULL)) {
|
||||||
|
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
|
||||||
|
"htmlCheckEncoding: wrong encoding meta\n",
|
||||||
|
NULL, NULL);
|
||||||
|
} else {
|
||||||
xmlSwitchEncoding(ctxt, enc);
|
xmlSwitchEncoding(ctxt, enc);
|
||||||
|
}
|
||||||
ctxt->charset = XML_CHAR_ENCODING_UTF8;
|
ctxt->charset = XML_CHAR_ENCODING_UTF8;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user