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

Re: Unable to rename a directory from English to T.Chinese

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-02-22 17:08:16 CET

plasma <plasma@ms9.hinet.net> writes:

> If a file's name is English, and renamed to Big5, it works just fine.
> If do the same operation to a directory, it fails:
>
> plasma@plasmanb:~/tmp/xyz/foo(0)> svn mv BugReport 'Bug¤Î«Øij'
> subversion/libsvn_subr/utf.c:363: (apr_err=22)
> svn: Can't recode string

Yes, that looks like a bug in svn_io_copy_dir_recursively. The
current code looks like:

      /* Telescope the entryname onto the source dir. */
      src_target = svn_path_join (src, this_entry.name, subpool);
      SVN_ERR (svn_path_cstring_to_utf8 (&src_target_utf8, src_target,
                                         subpool));
  
but src is already in UTF-8, thus src_target is inconsistent and the
conversion is invalid. I think the code should be more like:

      SVN_ERR (svn_path_cstring_to_utf8 (&entry_utf8, this_entry.name, ...));
      src_target = svn_path_join (src, entry_utf8, ...));

with something similar to construct dst_target.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 22 17:13:05 2005

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.