arbitrary characters in XML document?
cowan at locke.ccil.org
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 ccil.org
I am a member of a civilization. --David Brin
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/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev