#29978 [Opn->Bgs]: Using acute in DomElements

From: Date: Sat, 04 Sep 2004 17:01:20 +0000
Subject: #29978 [Opn->Bgs]: Using acute in DomElements
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65726@lists.php.net to get a copy of this message
ID: 29978 Updated by: chregu@php.net Reported By: guillaume dot forget at espci dot fr -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: NetBSD PHP Version: Irrelevant New Comment: DOMXML expects UTF-8 encoded input for set_attribute (and all other functions except loading a whole XML document, where the XML header is recognized) Previous Comments: ------------------------------------------------------------------------ [2004-09-04 13:37:57] guillaume dot forget at espci dot fr In the code, you have to read $balise = $node->append_child($test_node); instead of: $balise = $node->append_child($poly_node); ------------------------------------------------------------------------ [2004-09-04 13:33:49] guillaume dot forget at espci dot fr Description: ------------ Hi! I'm using domxml function for modifying xml files. But when I put acute (é,è,à,ô,ï,...), and try a DomElement->set_attribute(...), the resulting dom object is truncated at the acute place. I do not think the problem come from the DomObj->dump_mem() or DomObj->dump_file(...) functions because both gave the same result. If I remove the acutes, it works fine. Reproduce code: --------------- $xmlfile="test.xml"; $text="c'est l'été !"; $domobj = domxml_open_file ($xmlfile); $node = $domobj->last_child(); $test_node = $domobj->create_element("balise2"); $balise = $node->append_child($poly_node); $balise->set_attribute (test,$text); echo $domobj->dump_mem(); XML file (test.xml): <?xml version="1.0" encoding="ISO-8859-1"?> <balise1 /> Expected result: ---------------- <?xml version="1.0" encoding="ISO-8859-1"?> <balise1><balise2 test="c'est l'été !"/></balise1> Actual result: -------------- <?xml version="1.0" encoding="ISO-8859-1"?> <balise1> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29978&edit=1

« previous php.bugs (#65726) next »