arbitrary characters in XML document?

John Cowan cowan at
Thu Sep 2 23:08:25 BST 1999

Cliff Draper scripsit:

> I have an application where I want to store data in XML and retrieve
> it later.  Now a good chunk of the data I want to store is coming
> straight from the user and I have little control over exactly which
> character set the user is using.  One of my users apparently tried
> using 0x98 + 0x03 as an accented 'e'; I have no idea which character
> set he used (and I don't care), but I still want to be able to store
> it and parse it later.  When I parse it with expat with an
> encoding="UTF-8", it complains that it's not well-formed.

Too right.  Your data isn't really character data at all, from the
viewpoint of your XML application: it's raw bytes.  So you should
store it in Base64 or some similar format for representing raw
bytes as characters.

John Cowan                                   cowan at
       I am a member of a civilization. --David Brin

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list