]> granicus.if.org Git - php/commitdiff
MFB:When dumping entire document to file via asXml() don't lose the encoding
authorIlia Alshanetsky <iliaa@php.net>
Fri, 23 May 2008 15:46:24 +0000 (15:46 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 23 May 2008 15:46:24 +0000 (15:46 +0000)
ext/simplexml/simplexml.c

index 223d265a9ada51196b8ab194918c3556da8c02a2..c68850df31485247c5c55e8e687d2006a45f2c2a 100644 (file)
@@ -1392,7 +1392,7 @@ SXE_METHOD(asXML)
 
        if (node) {
                if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) {
-                       xmlDocDumpMemory((xmlDocPtr) sxe->document->ptr, &strval, &strval_len);
+                       xmlDocDumpMemoryEnc((xmlDocPtr) sxe->document->ptr, &strval, &strval_len, ((xmlDocPtr) sxe->document->ptr)->encoding);
                        RETVAL_STRINGL((char *)strval, strval_len, 1);
                        xmlFree(strval);
                } else {