fuzzy_escape function in libsvn_subr is not reversible
From: Jendro, Carsten (SAZ-DE) <CJendro_at_saz.net>
Date: 2007-11-06 10:52:01 CET
Hi,
I have a problem with svnlook when I use it to print an utf8 log message in the console.
Under windows it is not possible to set the output mode to utf8, so all text output will be escaped with the fuzzy_escape function located in libsvn_subr / utf.c
This pocess is not reversible, because every char >= 128 and 0 will be converted to a replacement in a format like "?\000". But the starting char of the replacement, the question mark (?) schould be replaced too to make it reversible.
For Example:
I use the following logmessage into svn.
>
I print it out with
svnlook.exe c:\repos -r 12345
>
When i try to convert this back to a correct utf8 string (may be inside a hook script) I get this:
>
The Function does exact what it should
> /* Copy LEN bytes of SRC, converting non-ASCII and zero bytes to ?\nnn
But it would be nice to make it reversible.
There are only 2 lines of code that must be changed, I have done it for myself in my own hook script.
> if (! svn_ctype_isascii(*src) || *src == '\0')
> if (! svn_ctype_isascii(*src_orig) || src_orig == '\0')
Can be changed in
> if (! svn_ctype_isascii(*src) || *src == '\0' || *src == '?')
> if (! svn_ctype_isascii(*src_orig) || src_orig == '\0' || *src == '?')
It would be nice it this can be implemented into svn, so I don't have to compile my own version for my hook scripts in the future.
Thx,
Carsten Jendro
---------------------------------------------------------------------
|
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.