Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   XML-Parser to XML-Parser communication (encoding issues?) (http://www.velocityreviews.com/forums/t894212-xml-parser-to-xml-parser-communication-encoding-issues.html)

arne 09-13-2005 12:53 PM

XML-Parser to XML-Parser communication (encoding issues?)
 
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



All times are GMT. The time now is 04:56 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.