On Fri, 4 Feb 2005 kfogel@tigris.org wrote:
> Modified: trunk/subversion/libsvn_subr/utf.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_subr/utf.c?view=diff&rev=12919&p1=trunk/subversion/libsvn_subr/utf.c&r1=12918&p2=trunk/subversion/libsvn_subr/utf.c&r2=12919
> ==============================================================================
> --- trunk/subversion/libsvn_subr/utf.c (original)
> +++ trunk/subversion/libsvn_subr/utf.c Fri Feb 4 15:11:50 2005
> @@ -725,6 +725,9 @@
> {
> if (! apr_isascii (*src_orig))
> {
> + /* ### This is the same format as svn_xml_fuzzy_escape()
> + ### uses. The two should probably share code, even
> + ### though they escape different characters. */
Thank you for the conflict:-) I am not sure this little abstraction is
worth a new API. I changed the note in the utf.c to say that we should
abstract it if we add another fuzzy escape somewhere.
> --- trunk/subversion/libsvn_subr/xml.c (original)
> +++ trunk/subversion/libsvn_subr/xml.c Fri Feb 4 15:11:50 2005
> @@ -25,6 +25,7 @@
> #include "svn_pools.h"
> #include "svn_xml.h"
> #include "svn_error.h"
> +#include "svn_ctype.h"
>
> #ifdef SVN_HAVE_OLD_EXPAT
> #include "xmlparse.h"
> @@ -265,6 +266,58 @@
> xml_escape_attr (outstr, string, (apr_size_t) strlen (string), pool);
> }
>
> +
> +const char *
> +svn_xml_fuzzy_escape (const char *string, apr_pool_t *pool)
> +{
> + const char *end = string + strlen (string);
> + const char *p = string, *q;
> + svn_stringbuf_t *outstr;
> + char escaped_char[6]; /* ? \ u u u \0 */
> +
> + for (q = p; q < end; q++)
> + {
> + if (svn_ctype_iscntrl (*q)
> + && ! ((*q == '\n') || (*q == '\r') || (*q == '\t')))
> + break;
> + }
This disallows the DEL character (ASCII 127), which is allowed in XML 1.0.
Regards,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 4 23:02:36 2005