diff options
Diffstat (limited to 'HTMLparser.c')
-rw-r--r-- | HTMLparser.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/HTMLparser.c b/HTMLparser.c index 2e7984d..309d93c 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -2091,6 +2091,7 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) { cur->ids = NULL; cur->refs = NULL; cur->_private = NULL; + cur->charset = XML_CHAR_ENCODING_UTF8; if ((ExternalID != NULL) || (URI != NULL)) xmlCreateIntSubset(cur, BAD_CAST "html", ExternalID, URI); @@ -5647,6 +5648,8 @@ htmlReadMemory(const char *buffer, int size, const char *URL, const char *encodi ctxt = xmlCreateMemoryParserCtxt(buffer, size); if (ctxt == NULL) return (NULL); + if (ctxt->sax != NULL) + memcpy(ctxt->sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandlerV1)); return (htmlDoRead(ctxt, URL, encoding, options, 0)); } |