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

index 37b2dd10923ef47fcf04b550da186e582e92f646..cfd4c869625a1a525e6e1723f2553f8da2d7883f 100644 (file)
@@ -1364,7 +1364,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 {