HI all ! I'm using XML::simple to parse a file build in a xml form. With a file on my compute I don't have any problems. But in fact, some informations is stocked in a mysql data base and a php send it in a xml form on a page. With a socket I save the xml and the pass it to xml::simple. I have problems with encoding, xml::simple says :
not well-formed (invalid token) at line 2, column 39, byte 61 at /usr/lib/perl5/XML/Parser.pm line 187 at /usr/lib/perl5/XML/Parser.pm line 192 XML::Parser::parse('XML::Parser=HASH(0x84e32c8)', '<?xml version="1.0"?>\x{a}<eleve nom="qsdqsd" prenom="Rapha...') called at /usr/local/share/perl/5.8.8/XML/Simple.pm line 343 XML::Simple::build_tree_xml_parser('XML::Simple=HASH(0x84e3244)', 'undef', 'SCALAR(0x82cfd58)') called at /usr/local/share/perl/5.8.8/XML/Simple.pm line 282 XML::Simple::build_tree('XML::Simple=HASH(0x84e3244)', 'undef', 'SCALAR(0x82cfd58)') called at /usr/local/share/perl/5.8.8/XML/Simple.pm line 223 XML::Simple::XMLin('<?xml version="1.0"?>\x{a}<eleve nom="qsdqsd" prenom="Rapha...') called at osp.pl line 64
my script bug because of this :
<eleve nom="qsdqsd" prenom="Raphaël" classe="Seconde L" adresse="Léon Bourgain" code_postal="3423" ville="machin" pays="France" telephone="3421434">
It's because I have some special caracters. How can I pass this problem, with encoding ? Thank you very much for your help !

In reply to XML::Simple and encoding by Girzi

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.