On Dec 27, 3:32 pm, withers <ro...@upperbri dge.co.ukwrote:
XML gives an error when I have a £ sign (GBP) - £ - in a string.
You must either use an encoding which supports that character (and use
the XML Declaration to tell the processor which encoding you're using,
unless it's UTF8 or UTF16), or use the numeric escape. XML processing
generally uses Unicode internally, so it can handle just about every
character you've ever heard of and many you haven't -- but UTF8
requires characters above 127 be represented by multiple bytes, and of
course UTF16 starts out as a two-byte-per-character encoding.
Characters below space (32) -- the "control characters" -- are flat-
out illegal in XML 1.0. XML 1.1 relaxes this constraint, but is not
yet widely supported. The usual solution, if you must handle these, is
to do a base-64 encoding of your data before putting it into the XML
and reverse that before using it.
See the XML Recommendation for a discussion of which characters can,
and can't, be directly represented in XML. See the UTF8 spec for a
discussion of how its variable-length character encoding works.