Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-07-18 15:27:40


> The '\0' character is not valid anywhere in XML, in any encoding. I
> don't know the reasoning but it means you have to use some kind of
> alternative representation for data that could contain NULs.

> If you're talking text strings with embedded NULs then you might need
> to define an entity that can stand in for the NUL, so you can expand
> it
> back to NUL when you recreate the string from the XML archive, or put
> all strings that might contain NULs in an element like <hex> and
> hex-encode the bytes. There might be other solutions too, but I've
> not
> used them.
>
> jon

Basically we want to map anything that might be contain in a std::string or
std::wstring
to an XML value string. I little investigation makes me think that the
appropriate
mechanism is to escape all "non-printable" (uh-oh?) or some subset of
"problem characters"
using the % escape syntax. It looks to me as non-obvious problem but I have
yet to delve into it.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk