Processing XML with Perl | ![]() | Michel Rodriguez |
![]() More on the XML recommendation (cont'd) | ![]() | ![]() More on the XML recommendation (cont'd) |
More on the XML recommendation (cont'd)
Encodings
the encoding of a document is the character set used to encode it
- encodings are declared in the XML declaration
<?xml version="1.0" encoding="ISO-8859-1"?>
- XML promotes, but do not impose, Unicode (UTF-8 or UTF-16)
- US-ASCII and UTF-8 are identical (for the first 128 characters)
- Perl supports UTF-8 as of 5.6.0, albeit there are still problems
- either you can ignore encodings or they will make you miserable
This is a valid XML document:

![]() More on the XML recommendation (cont'd) | ![]() | ![]() More on the XML recommendation (cont'd) |