From: Ilia Alshanetsky Date: Fri, 23 May 2008 15:46:54 +0000 (+0000) Subject: When dumping entire document to file via asXml() don't lose the encoding X-Git-Tag: php-5.2.7RC1~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c29dac2f3211bb0ff9c4ab496b55febc548f4979;p=php When dumping entire document to file via asXml() don't lose the encoding --- 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 {