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

Re: Are log messages Unicode?

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sun, 13 Jul 2008 08:43:34 +0300 (Jerusalem Daylight Time)

Karl Fogel wrote on Mon, 7 Jul 2008 at 12:15 -0400:
> "Ben Collins-Sussman" <sussman_at_red-bean.com> writes:
> > On Sun, Jul 6, 2008 at 5:23 AM, Barry Scott <barry_at_barrys-emacs.org> wrote:
> >> Using the svn_client API is it possible for a client to write
> >> none-UTF-8 log messages?
> >> Clearly if this happened it would be a bug in the client given the
> >> above statement.
> >
> > I don't recall the details, but it's actually the *programmers'*
> > burden to convert paths and log messages from native locale to UTF8
> > (and back again). If you read the svn APIs, you'll notice that every
> > path and log message passed into APIs (or passed around between APIs)
> > are presumed to *already* be UTF8. So if you're writing your own
> > client, it's your job to convert user input to UTF8 before passing to
> > svn_client_*(). Look at the commandline client to see how it's doing
> > that; I believe there a number of convenience routines in libsvn_subr
> > to help with conversion.
>
> I think Barry's asking if the client and/or server do any validation.
> That is, if the programmer supplies a non-UTF8 log message, our client
> libraries should reject it; and if such a log message were to reach the
> repository (perhaps because someone wrote their own client software from
> scratch), the repository should reject it too.
>
> I don't know whether we do such validation or not, but agree we should.
>

Since r31614 (Neels' fix of issue #1796) we do UTF-8 validation of log
messages in libsvn_repos. It has not been backported to 1.5.x.

The cmdline client also does some conversions; in my case, it
dropped the bytes it couldn't understand:

    % svn ci iota -F dump-fragment.txt
    Sending iota
    Transmitting file data .
    Committed revision 2.
    
    # It should have failed. Let's see...
    % xxd ../../repos1/db/revprops/0/2
    ...
    00000a0: 370a 7376 6e3a 6c6f 670a 5620 3130 310a 7.svn:log.V 101.
    00000b0: 4269 7462 7563 6b65 7420 7273 6572 7620 Bitbucket rserv
    00000c0: 2064 6576 2f6e 756c 6c0a 436c 6173 7365 dev/null.Classe
    ...

    # Ah, but that's not the log message I specified!
    % xxd dump-fragment.txt
    0000040: 380a 0a4b 2037 0a73 766e 3a6c 6f67 0a56 8..K 7.svn:log.V
    0000050: 2031 3031 0a42 6974 6275 636b 6574 2072 101.Bitbucket r
    0000060: e973 6572 76e9 20e0 2064 6576 2f6e 756c .serv. . dev/nul
    # It dropped these bytes: ^ ^ ^

> Barry, got time to test/trace it?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-13 07:43:51 CEST

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.