Velocity Reviews

Velocity Reviews (
-   Perl Misc (
-   -   XML-Parser to XML-Parser communication (encoding issues?) (

arne 09-13-2005 12:53 PM

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

I've written a XML-daemon to let third partie's communicate with our

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&#195;&#169;h&#195;&#169;</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

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&#195;ƒ&#194;&#169;h&#195;ƒ&#19 4;&#169;</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

thx in advance

All times are GMT. The time now is 06:06 AM.

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