Hi all
I'm having problems using XML::Simple to parse a data file containing the '£' symbol.
The data appears to read in correctly without error, but when I come to output it, the symbol appears as '£'.
Trawling as much documentation as I could find, SuperSearching and googling it looks like this is a problem with the encoding - the XML::Parser transforms everything to UTF-8 internally which can't handle '£' correctly. If I understand correctly it performs a bit shift that changes it into the 2-byte char that gets output.
The problem I have is how to get the correct symbol back when I read the data back out.
I've tried playing with the various encoding options of XML::Simple (and I've tried XML::DOM also) but to no avail. Maybe I'm missing something obvious by staring at it too hard.
Any help would be greatly appreciated :)
Update
Thanks for all the helpful advice everyone! I think I have a few possible solutions now to the problem (which I'll have to find which will work best under the system / network architecture that we have here) which is a lot more than the "none" that I had when I started :)
You've saved me a lot of torn out hair :)
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:??;
In reply to Problem reading £ sign with XML::Simple by gothic_mallard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |