Please help me...
here is the detail scenario..
I have an xml file containing xml tags e.g.
data.xml - following its content
-----------------
<data>
<node1>some text</node1>
</data>
-------------------
Now I uploaded this file to my translations service. my code loads the file... following is the php code
$dom = new DOMDocument('1.0', 'utf-8');
if ( !$dom->load($target_file) ) {
echo "Cannot load file $target_file";
exit;
}
then my logic operates and replaces the node value with some accented characters e.g. nënë and it works fine and finally i save the file
$dom->save($target_file);
Now the output should be like as follow
data.xml - following its content
-----------------
<?xml version="1.0" encoding="utf-8"?>
<data>
<node1>nënë</node1>
</data>
-------------------
BUT When i open the file the output as follow
-------------------
<?xml version="1.0"?>
<data>
<node1>nënë</node1>
</data>
-------------------
please Help me ... How should I make sure that xml file encoding should be UTF-8?????
Waiting......
utf8_encode()(php.net/manual/en/function.utf8-encode.php) on the text string before you insert it into theDOMDocumentobject