From 64354ea7d6b8e0d95f3f9bcfdc98bddd065b65fc Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 31 Mar 2005 15:22:56 +0000 Subject: [PATCH] fixed bug reported by Petr Pajas, in the absence of encoding UTF-8 should * xmlsave.c: fixed bug reported by Petr Pajas, in the absence of encoding UTF-8 should really be assumed. This may break if the HTTP headers indicates for example ISO-8859-1 since this then becomes a well formedness error. Daniel --- ChangeLog | 7 +++++++ xmlsave.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9eec4564..de8ad9b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Mar 31 17:20:32 CEST 2005 Daniel Veillard + + * xmlsave.c: fixed bug reported by Petr Pajas, in the absence of + encoding UTF-8 should really be assumed. This may break if + the HTTP headers indicates for example ISO-8859-1 since this + then becomes a well formedness error. + Thu Mar 31 16:57:18 CEST 2005 Daniel Veillard * SAX.c: fixed #172260 redundant assignment. diff --git a/xmlsave.c b/xmlsave.c index a894bc9b..94ad085f 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -1808,6 +1808,9 @@ xmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, if ((buf == NULL) || (cur == NULL)) return; + if (encoding == NULL) + encoding = "UTF-8"; + memset(&ctxt, 0, sizeof(ctxt)); ctxt.doc = doc; ctxt.buf = buf;