First UTF-8 is perfectly capable of handling £, it's just that it encodes it differently from your original encoding, which you did not specify BTW.

Did you search the XML::Simple docs for 'encoding'? The second set of hits gives you a possible solution:

OutputFile => <file specifier> # out - handy The default behaviour of "XMLout()" is to return the XML as a s +tring. If you wish to write the XML to a file, simply supply the filen +ame using the 'OutputFile' option. This option also accepts an IO handle object - especially usefu +l in Perl 5.8.0 and later for writing out in an encoding other than +UTF-8, eg: open my $fh, '>:encoding(iso-8859-1)', $path or die "open($pa +th): $!"; XMLout($ref, OutputFile => $fh);

Other alternatives include post-processing the output file with iconv, Text::Iconv or using Encode if you are running perl 5.8.*


In reply to Re: Problem reading £ sign with XML::Simple by mirod
in thread Problem reading £ sign with XML::Simple by gothic_mallard

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.