in reply to Re: Problem reading £ sign with XML::Simple
in thread Problem reading £ sign with XML::Simple
I've tried a few different encodings in the original file with the <?xml version='1.0' encoding='blah'?> declaration: iso-8859-1, utf8 and utf16 (although the latter refused to parse the file).
The data isn't being output by XML::Simple, rather it's coming out such as:
use XML::Simple; my $x = XMLin('myxmlfile.xml'); print "This costs: " . $x->{item}->{cost} ."\n";
Where as an example the XML is:
<?xml version='1.0' encoding='iso-8859-1'?> <catalogue> <item> <cost>£300</cost> </item> </catalogue>
i.e. The values are being pulled out individually and inserted into a new file (which in the real case ends up producing a PDF, but the same behaviour occurs if I drop the values into a plain ASCII file or a HTML doc)
Now I need to find a version of Text::Iconv that I can use on my system (ActivePerl 5.6.1 (Build 638) MSWin32-x86-multi-thread)
All code is untested unless otherwise stated.
All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
If in doubt ask.
s++blah+;y(bl) .j.s;s+(h)+p$1+;???print:??;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problem reading £ sign with XML::Simple
by mirod (Canon) on Apr 27, 2005 at 10:40 UTC | |
|
Re^3: Problem reading £ sign with XML::Simple
by dave_the_m (Monsignor) on Apr 27, 2005 at 10:20 UTC | |
|
Re^3: Problem reading £ sign with XML::Simple
by demerphq (Chancellor) on Apr 27, 2005 at 15:51 UTC | |
|
Re^3: Problem reading £ sign with XML::Simple
by alexz (Beadle) on Apr 27, 2005 at 18:19 UTC |