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

Re: Problem with control characters in filenames

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2006-06-23 19:10:03 CEST

Laurent Saboret wrote:

> I may have discovered a (minor) bug in TortoiseSVN related to control
> characters in filenames.
>
> The problem is:
> * Create with Windows Explorer a file named "faa?1" where ? is the ASCII
> character 1 (type Alt+1). Explorer displays this character as a square.
> * TortoiseSVN is fine with this filename: add, commit, update, rename
> and log work fine.
> * In the other hand, "svn update" breaks svn client on Linux with a
> message "svn: Can't convert string from 'UTF-8' to native encoding: svn:
> faa?\226?\152?\1861".
> Note that the error message is the same when $LANG/$LC_CTYPE are set to
> fr_FR.iso88591 or en_US.UTF-8.
>
> The same problem occur with all control characters from 1 to 31 and 127.

So this seems to be not a TSVN problem (hey, all TSVN commands work fine
with that filename) but a Linux/setup problem (or a Subversion problem
on Linux).

> My configuration:
> The svn server runs svn 1.1.4. I access the repository via svn+ssh.
> I use as client TortoiseSVN 1.3.4 on Windows NT SP2 and svn 1.3.2 on
> Linux Fedora Core 3.
>
> My guess:
> According to http://subversion.tigris.org/issues/show_bug.cgi?id=1954,
> control characters 0x0 to 0x1f and 0x7f are not supported in filenames
> by SVN (because they cannot be represented in XML) and are rejected by
> svn client and server >= 1.2.

AFAIK they're not rejected but 'converted' on the wire to something that
can be represented in XML.

> My guess is that TortoiseSVN doesn't check that. As the old svn 1.1.4

Yes, but so does the Subversion CL client. Ok, you can't really add such
a file with the CL client, but that's not because of the client but
because of the console.
Unfortunately, Subversion doesn't provide a function to validate a
path/url before passing one to their API (I've asked for such a
function, but seems they don't want to implement one).

> server doesn't check it either, a filename with ASCII character 1 can be
> committed.
> I assume that the filename gets corrupted in SVN repository, which makes
> svn Linux client complain about an invalid UTF-8 character.
>
> I believe that the problem is minor, thus my SVN server administrator
> will not agree to upgrade svn.
> I tried to install a pre-commit hook to reject control characters in
> filenames. It doesn't work as the filename is already corrupted to
> "faa??1" where ?? is the wide character 9786.

So just check for that wide character string - or do you actually use
that one in a real filename?

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Fri Jun 23 19:10:19 2006

This is an archived mail posted to the TortoiseSVN Users mailing list.

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