[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Control characters in log message cause failure

From: <kfogel_at_collab.net>
Date: 2004-12-01 21:08:34 CET

I wrote:
> Julian Reschke <julian.reschke@gmx.de> writes:
> > Wrong. CDATA doersn't change anything. It's still the same set of
> > characters that are allowed (see for instance
> > <http://greenbytes.de/tech/webdav/rfc3470.html#binary>).
>
> So XML CDATA cannot represent arbitrary strings of bytes, by using
> escaping?
>
> /me sits stunned in his chair

Sorry, I'm not being very clear about things.

Obviously, we can encode anything we want using Base64. So it's not
so surprising that XML's CDATA rules are what you (and that helpful
reference) say they are. It's not limiting what we can do, it's just
making us jump through another hoop to do it.

So my pseudo-code from before should really look like this:

   /* sending a log msg from server to client */

   if (is_valid_utf8 (msg)) {
     if (svn_xml_is_xml_safe (msg)) {
       send_message (escape_xml (msg));
     }
     else {
       send_message (base64_escape (msg));
     }
   }
   else {
       send_message (fuzzy_escape (msg));
   }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 1 21:17:41 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.