Character Range: surrogate blocks

Rick Jelliffe ricko at allette.com.au
Sun Oct 18 11:41:47 BST 1998



> From: owner-xml-dev at ic.ac.uk [mailto:owner-xml-dev at ic.ac.uk]On Behalf Of
> Richard Emberson

> Why was it decided to exclude the uses of surrogate
> block-base Unicode characters within XML documents?

It makes no sense to allow numeric character references to surrogates. You
can directly use a numeric character reference to the character which the
surrogate-pair encodes!

Every character in a document on a computer is in some encoding. In
particular:--

* When stored in a file, an XML document may be encoded in any encoding that
IANA accepts (providing it has most of the ASCII characters), including
Unicode.

* When made available through DOM, an XML document is encoded using Unicode.

All characters (except Private-Area characters, by their nature) are
interpreted according to ISO 10646 specifications, regardless of their
encoding. A surrogate is not a character, in the abstract: it is an encoding
of a future ISO 10646 character with a value greater than (2^16)-1.

Before the addition of surrogates, Unicode characters took one codepoint,
and it was possible to speak loosely of ISO 10646 characters and Unicode
codepoints as if they were the same thing (more or less). That was one of
the charms of Unicode. But with the addition of surrogates, this convenience
does not apply (to the surrogate area) and life is more complicated.

Personally, I think we should aim at allowing *more* character encodings,
not fewer, in XML documents. Encoding is a compression optimized for a
locale. As long as the encoding of a document is clearly labelled, and the
transcoding of that encoding to ISO10646 is established, and as long as the
distinctions of codepoints/characters and standard/private characters is
kept, I can only think that multiple encodings do not represent a "mess",
but something of great value.  However, this value probably does not extend
to text when it is inside an XML application: so the fact that DOM uses
Unicode, and not some more generic char* or wchar_t*, is to be applauded,
IMHO.


Rick Jelliffe


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list