in reply to Re: string mis-match?
in thread string mis-match?
But SOAP is sending in a single-byte x'a3 - which is the ASCII code for a £
ASCII codes end at 0x7F. Everything beyond that is something else. ISO-8859-1 and its superset Windows-1252 use 0xA3 to represent £. So maybe SOAP is sending data encoded in ISO-8859-1 or Windows-1252. Maybe it is a different encoding that also uses 0xA3 to represent £. https://en.wikipedia.org/wiki/ISO/IEC_8859 documents that 0xA3 represents £ in ISO-8859-1, -3, -7, -8, -9, -13, -14, and -15.
I have tried using Encode's 'decode_utf8' on the string received from SOAP
How do you expect that to work? Did you actually read the Encode documentation? decode_utf8() expects a UTF-8 encoded bytestream and returns a perl string. You feed it a bytestream that is encoded in ISO-8859-1, Windows-1252, or somethings else, but not UTF-8. You need a function that can decode the encoding used for the bytestream from SOAP into a perl string. That function is called decode() and unlike decode_utf8(), it also expects an encoding name. See Encode for details.
Alexander
|
|---|