in reply to Problem reading £ sign with XML::Simple
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.*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem reading £ sign with XML::Simple
by gothic_mallard (Pilgrim) on Apr 27, 2005 at 09:45 UTC | |
by mirod (Canon) on Apr 27, 2005 at 10:40 UTC | |
by dave_the_m (Monsignor) on Apr 27, 2005 at 10:20 UTC | |
by demerphq (Chancellor) on Apr 27, 2005 at 15:51 UTC | |
by alexz (Beadle) on Apr 27, 2005 at 18:19 UTC |