note 88525 modified in domdocument.savexml by danbrown
| From: | danbrown@php.net | Date: | Tue, 16 Feb 2010 23:25:00 +0000 |
| Subject: | note 88525 modified in domdocument.savexml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166031@lists.php.net to get a copy of this message | ||
if you are storing multi-byte characters in XML, then saving the XML using saveXML() will create
problems. It will spit out the characters converted in encoded format.
<?php
$str = domdoc->saveXML(); // gives "&x#1245;" some encoded data
?>
Instead do the following
<?php
$str = domdoc->saveXML(domdoc->documentElement); // gives
"ä¿åãã¾ãã" correct multi-byte data
?>
--was--
if you are storing multi-byte characters in XML, then saving the XML using saveXML() will create
problems. It will spit out the characters converted in encoded format.
$str = domdoc->saveXML(); // gives "&x#1245;" some encoded data
Instead do the following
$str = domdoc->saveXML(domdoc->documentElement); // gives
"ä¿åãã¾ãã" correct multi-byte data
http://php.net/manual/en/domdocument.savexml.php