]> 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:54 +0000 (15:46 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 23 May 2008 15:46:54 +0000 (15:46 +0000)
NEWS
ext/simplexml/simplexml.c

diff --git a/NEWS b/NEWS
index 98329a2f9781461ad23180d2a88bb4f462b8e236..28f95a3a3d51036e3931dbdd3d7aeee228bb4520 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2008, PHP 5.2.7
+- When dumping entire document to file via asXml() don't lose the encoding.
+  (Ilia)
 - Fixed a crash inside PDO when trying instantiate PDORow manually (Felipe)
 - Fixed build failure of ext/mysqli with libmysql 6.0 - missing rpl
   functions. (Andrey)
index c0659e9f075572be808b3ccbd737444cceaf12ba..03320bf2ffdea5f844704e3af1efcc199ac13415 100644 (file)
@@ -1323,7 +1323,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 {