#34730 [NEW]: saveXML translates UTF-8 characters to entities

From: Date: Tue, 04 Oct 2005 12:46:30 +0000
Subject: #34730 [NEW]: saveXML translates UTF-8 characters to entities
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85991@lists.php.net to get a copy of this message
From:             pesmail2003 at seznam dot cz
Operating system: Linux 2.6.10-5-i386
PHP version:      5.0.5
PHP Bug Type:     DOM XML related
Bug description:  saveXML translates UTF-8 characters to entities

Description:
------------
saveXML function replaces UTF-8 characters to entities. If I have some
UTF-8 characters in my loaded XML file and want to save it with saveXML,
it replace everything to entities like this č ř ž
ýá í é I had to write my own saveXML in PHP and it's
really bad.

Reproduce code:
---------------
<?php
$xmlData = <<<XMLCODE
<?xml version="1.0" ?>
<test>"ìšèøžýáíé</test>
XMLCODE;

$dom = new DomDocument;
$dom->loadXML( $xmlData );
echo $dom->saveXML();
?>

Expected result:
----------------
<?xml version="1.0"?>
<test>"ìšèøžýáíé</test>

Actual result:
--------------
<?xml version="1.0"?>
<test>"&#x11B;&#x161;&#x10D;&#x159;&#x17E;&#xFD;&#xE1;&#xED;&#xE9;</test>

-- 
Edit bug report at http://bugs.php.net/?id=34730&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34730&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34730&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34730&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34730&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34730&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34730&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34730&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34730&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34730&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34730&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=34730&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=34730&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34730&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34730&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34730&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34730&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34730&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34730&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34730&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34730&r=mysqlcfg


Thread (8 messages)

« previous php.bugs (#85991) next »