patch from Robert Schwebel , allows to compile the example if configured
* doc/examples/reader3.c: patch from Robert Schwebel , allows to
compile the example if configured without output support fixes
#545582
* Makefile.am: add testrecurse to the make check tests
* HTMLparser.c: if the parser got a encoding argument it should be
used over what the meta specifies, patch fixing #536346
Daniel
svn path=/trunk/; revision=3785
diff --git a/HTMLparser.c b/HTMLparser.c
index a16faf6..57e64df 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -5973,8 +5973,12 @@
xmlCharEncodingHandlerPtr hdlr;
hdlr = xmlFindCharEncodingHandler(encoding);
- if (hdlr != NULL)
+ if (hdlr != NULL) {
xmlSwitchToEncoding(ctxt, hdlr);
+ if (ctxt->input->encoding != NULL)
+ xmlFree((xmlChar *) ctxt->input->encoding);
+ ctxt->input->encoding = xmlStrdup((xmlChar *)encoding);
+ }
}
if ((URL != NULL) && (ctxt->input != NULL) &&
(ctxt->input->filename == NULL))