ID: 34730 User updated by: pesmail2003 at seznam dot cz Reported By: pesmail2003 at seznam dot cz -Status: Bogus +Status: Closed Bug Type: DOM XML related Operating System: Linux 2.6.10-5-i386 PHP Version: 5.0.5 New Comment:
Thanks a lot chregu! I though I have latest version, but I hadn't. I've upgraded to libxml 2.6.21 (was 2.6.17) and now it works as expected. My fault I didn't test it before posting bug report. Thanks everyone, great job. Previous Comments: ------------------------------------------------------------------------ [2005-10-04 18:56:09] [EMAIL PROTECTED] works for me as expected (php 5.0.6-dev) which libxml2 version are you using ------------------------------------------------------------------------ [2005-10-04 15:14:14] pesmail2003 at seznam dot cz I'm sending updated test code. Plase don't throw this bugreport immediately away as "bogus". I really don't want to use this as support forum, and don't want to stupidly chat with developers. Maybe I sent bad example for the first time, but I'm trying to do what I can to help you to help me. Maybe we will find I'm dumb but maybe we will find and fix some problem together. Reproduce code -------------- <?php $xmlData = <<<XMLCODE <?xml version="1.0" encoding="utf-8"?> <test>"èøýáíé</test> XMLCODE; $dom = new DomDocument; $dom->loadXML( $xmlData ); echo $dom->saveXML($dom->firstChild); ?> Expected result --------------- <test>"ìèøýáíé</test> Actual result --------------- <test>"ščřžýáíé</test> ------------------------------------------------------------------------ [2005-10-04 15:02:15] [EMAIL PROTECTED] Not without an example, but as this is not a user forum, please ask this kinds of questions on the php-general@lists.php.net mailinglist. ------------------------------------------------------------------------ [2005-10-04 14:57:50] pesmail2003 at seznam dot cz Thanks derick for fast response. But I found something interesting. When I set encoding in XML with <?xml version="1.0" encoding="UTF-8"?>, it works OK. But there is still no way to disable replacing special characters with entities when I have proper encoding and want to use saveXML with parameter "node" to save only part of the tree. Any solution to this? ------------------------------------------------------------------------ [2005-10-04 14:53:11] [EMAIL PROTECTED] You need to specify the charset encoding in your XML, like so: <?php $xmlData = <<<XMLCODE <?xml version="1.0" encoding="utf8"?> <test>"пÑиваÑе</test> XMLCODE; $dom = new DomDocument; $dom->loadXML( $xmlData ); echo $dom->saveXML(); ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/34730 -- Edit this bug report at http://bugs.php.net/?id=34730&edit=1