From c29dac2f3211bb0ff9c4ab496b55febc548f4979 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 23 May 2008 15:46:54 +0000 Subject: [PATCH] When dumping entire document to file via asXml() don't lose the encoding --- NEWS | 2 ++ ext/simplexml/simplexml.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 98329a2f97..28f95a3a3d 100644 --- 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) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index c0659e9f07..03320bf2ff 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -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 { -- 2.40.0