A
arne
Hi
I've written a XML-daemon to let third partie's communicate with our
backend.
The daemon itself is writte with XML::TreeBuilder (which uses on its turn
XML::Element && XML:
arser).
the daemon can handle multiple charsets, and everything works fine.
The problem came when I wrote a perl-client (until now I've used php),
that also users the above CPAN modules.
So the situation is now
client generates XML (UTF-8) and sends to the daemon the output of
->as_XML() (over a tcp socket), in this case:
<?xml version="1.0" encoding="UTF-8"?><smartyrequest><form type="echo-req" version="1"><text>héhé</text></form><auth><KID>K12345678</KID><username>admin</username><hash>b65b16a31dc80bdeadd50cde73c29993</hash></auth></smartyrequest>
(first differences, my php code doesn't expand the special chars, so it is
<text>héhél</text>)
the daemon accepts this, and takes the text in <text> with ->as_text(),
and puts it in another xml, sending it back to the client
this is what i get
<?xml version="1.0" encoding="UTF-8"?><smartyrequest><form type="echo-answer" version="1"><text>héhé</text></form></smartyrequest>
outputed as h\uffff\uffff\uffff©h\uffff\uffff\uffff© (instead of héhél)
in php this works fine.
So i suspect that XML:
arser can't handle the expanded character
references? or do I need to use an option (now I just use ->parse and
->parsefile).
thx in advance
Arne
I've written a XML-daemon to let third partie's communicate with our
backend.
The daemon itself is writte with XML::TreeBuilder (which uses on its turn
XML::Element && XML:
the daemon can handle multiple charsets, and everything works fine.
The problem came when I wrote a perl-client (until now I've used php),
that also users the above CPAN modules.
So the situation is now
client generates XML (UTF-8) and sends to the daemon the output of
->as_XML() (over a tcp socket), in this case:
<?xml version="1.0" encoding="UTF-8"?><smartyrequest><form type="echo-req" version="1"><text>héhé</text></form><auth><KID>K12345678</KID><username>admin</username><hash>b65b16a31dc80bdeadd50cde73c29993</hash></auth></smartyrequest>
(first differences, my php code doesn't expand the special chars, so it is
<text>héhél</text>)
the daemon accepts this, and takes the text in <text> with ->as_text(),
and puts it in another xml, sending it back to the client
this is what i get
<?xml version="1.0" encoding="UTF-8"?><smartyrequest><form type="echo-answer" version="1"><text>héhé</text></form></smartyrequest>
outputed as h\uffff\uffff\uffff©h\uffff\uffff\uffff© (instead of héhél)
in php this works fine.
So i suspect that XML:
references? or do I need to use an option (now I just use ->parse and
->parsefile).
thx in advance
Arne