Hi all, dear Monks.

I'm trying to create a client/server application relying on a big data structure that has to be sent from one peer to another. I've tried to work out a solution using XML::Simple and XML::Dumper. However, there have been some issues with both of them and I feel overwhelmed already; therefore I am asking for your wisdom and guidance :P.

I guess the problem here are the encodings. I need support for ISO-8859-1 characters; however, the first doesn't seem to support them, and neither does the latter. (ps, apart from that, XML::Dumper::xml2pl doesn't seem to work, is that just me or a bug in the module :?)

Then, while checking the Data::DumpXML manpage, I found the following statement:

Class names with 8-bit characters will be dumped as Latin-1, but converted to UTF-8 when restored by the Data::DumpXML::Parser.

Which I guess renders this module also unusable for my purposes. Do you know of any other nice way to do the right thing (i.e. converting a hash of hashes into XML and then to a struct again) with properly-encoded XML, and, if possible, using a single module? (note: tr///ing is not acceptable ;-))

Thanks a lot for your help, and happy new year :P


In reply to XML encoding problems... by Lasker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.