Package: libsvn1
Version: 1.5.1dfsg1-2
Severity: normal

Problem:

I've got a subversion repository stored at a path which contains UTF-8 encoded
cyrillic characters. Basic SVN operations like checkouts and commits work fine.
However, trac's trac-admin tool refuses to resync and instead tells that it 
cannot
find the specified repository:
  Command failed: /srv/дждждж does not appear to be a Subversion repository.

Reason:

It turns out that Subversion tries to convert (decode) the path argument 
whenever
it thinks that it's not UTF-8 in get_path_encoding(). This in turn relies on APR
which tells that with the exception of Darwin, which has UTF-8 encoded paths,
the paths on Linux are locale-specific, in apr_filepath_encoding().
As it tries to encode an already UTF-8 encoded path into UTF-8, only garbage 
comes
out of the conversion.

Solution/workaround:

trac-admin resync works fine when I modify libsvn's svn_path_cstring_from_utf8 
in
libsvn_subr/path.c to always assume UTF-8 encoded paths independently of what 
APR
tells it.
Obviously, this assumption cannot be generalised, but given that in the case of
assumed locale-specific encodings no proper decoding is performed, it looks to 
me
like most users would benefit from such a change.

As an additional modification, I've changed svn_utf_cstring_from_utf8 to
svn_path_cstring_from_utf8 in libsvn_repos/repos.c, otherwise it wouldn't take
advantage of the change above. This looks like an oversight in the code to me,
there shouldn't be a reason to use svn_utf_cstring_from_utf8 directly without 
the
svn_path_cstring_from_utf8 safety wrapper.

In summary, the first issue needs some more logic to find out whether the paths
of the system in question are encoded in UTF-8 (something which is safer to 
assume
by default than locale-specific encodings on Debian IMHO); the second issue 
should
be an easy bugfix.

-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libsvn1 depends on:
ii  libapr1           1.2.12-5               The Apache Portable Runtime Librar
ii  libaprutil1       1.2.12+dfsg-8+lenny2   The Apache Portable Runtime Utilit
ii  libc6             2.7-18                 GNU C Library: Shared libraries
ii  libdb4.6          4.6.21-11              Berkeley v4.6 Database Libraries [
ii  libneon27-gnutls  0.28.2-6.1             An HTTP and WebDAV client library 
ii  libsasl2-2        2.1.22.dfsg1-23+lenny1 Cyrus SASL - authentication abstra
ii  libserf-0-0       0.2.0-1                high-performance asynchronous HTTP
ii  zlib1g            1:1.2.3.3.dfsg-12      compression library - runtime

libsvn1 recommends no packages.

libsvn1 suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to