Hi all,
I want to build a nice XML tree from scratch:
$doc = new_xmldoc("1.0");
$doc->encoding = "iso-8859-2";
$root = $doc->add_root("registration");
$root->new_child("login", $data->login);
$root->new_child("name", data->name);
echo $doc->dumpmem();
It seems to me, that setting the encoding this way has no effect, since the result is something like this:
<?xml version="1.0"?>
<registration>
<login>...</login>
<name>...</name>
</registration>
Checking the encoding as
echo $doc->encoding;
gives the correct result (iso-8859-2) however.
When the nodes' values contain accents, I get only their codes on the output like: ᩵ú
I tried another method:
$doc = xmldoc('<?xml version="1.0" encoding="iso-8859-2"?><registration/>');
$root = $doc->root();
$root->new_child("login", $data->login);
$root->new_child("name", data->name);
echo $doc->dumpmem();
This way I get the correct output:
<?xml version="1.0" encoding="iso-8859-2"?>
But when there are accents the result is terrible: the output is truncated at the first irregular character that is when a character with accent appears the rest of the string simply disappears.
Is there a way to use this modul with non-us charset?
Thanks for any help bye, Peter