XML-Parser to XML-Parser communication (encoding issues?)

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::parser).

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::parser 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top