set encoding
Brought to you by:
bs_php,
nigelswinson
From: Gabriel T. <gth...@we...> - 2004-02-04 11:21:15
|
Hi all, I'm trying to set the encoding for my document. $options=array('XML_OPTION_TARGET_ENCODING' => "UTF-8"); $doc = new XPath(); $doc->importFromFile('request.xml'); $doc->setXmlOptions($options); $test=$doc->getNode(); print_r($test); $doc->exportToFile("NewXml1.xml"); No Errors but the latin-1 encoding from the imported file has not changed. In the end i want to create a new xml-document with utf-8 encoding. I tried: $doc = new XPath(); $doc->appendChild('', "<test></test>", true ); so far, it's working but again setting the encoding fails: $doc->setXmlOptions($options); or $doc->setXmlOption("XML_OPTION_TARGET_ENCODING", "UTF-8"); I know somehow I have to set the textParts-array of the super-root, but there has to be a nicer way to do this.. Thanks! Gabriel mailto:gth...@we... |