From 33cb218c93dc897d90761554582b37a3a766b240 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 23 May 2008 15:46:13 +0000 Subject: [PATCH] When dumping entire document to file via asXml() don't lose the encoding --- ext/simplexml/simplexml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 37b2dd1092..cfd4c86962 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -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 { -- 2.50.1