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

Discussion in 'Perl Misc' started by arne, Sep 13, 2005.

  1. arne

    arne Guest

    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
    arne, Sep 13, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    16,216
    Steve W. Jackson
    Sep 15, 2005
  2. Ghislain Benrais

    Xml parser and character encoding

    Ghislain Benrais, Jun 26, 2006, in forum: Java
    Replies:
    8
    Views:
    940
    Dale King
    Jun 28, 2006
  3. k2
    Replies:
    3
    Views:
    404
    Richard Maher
    Feb 25, 2007
  4. Sean
    Replies:
    3
    Views:
    271
    robic0
    Oct 3, 2006
  5. Sean
    Replies:
    0
    Views:
    366
Loading...

Share This Page