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

Re: [TSVN] url field in .svn/entries file is not %-escaped for non-ASCII chars

From: Hiroharu Tamaru <tamaru_at_myn.rcast.u-tokyo.ac.jp>
Date: 2005-05-13 11:10:59 CEST

At Thu, 12 May 2005 18:42:09 +0200, SteveKing wrote:

> Hiroharu Tamaru wrote:

> > I'v found that the checkout procedure of TortoiseSVN (tested
> > 1.1.3, 1.1.7) does not %-escape the repository URL string
> > passed from the user, when writing the .svn/entries file.
> >
> > People at dev@subversion list told me that URI must have
> > non-ASCII characters escaped, and the libraries and command
> > line version of subversion should and do strip such raw
> > non-ASCII characters, and could eventually fail the command
> > in unexpected manners.
> >
> > So I assume TortoiseSVN should %-escape the non-ASCII chars
> > in user supplied repository URL, or else at least reject
> > something that contains such chars.
>
> Should be fixed now in revision 3323.
> Can you please test the next nightly build and see if your issue is
> fixed for good?

I've verified with TortoiseSVN-1.2.0.3333-dev-svn-1.2.x.msi
and the problem is fixed.
Thank you very much for your rapid fix.

While I was verifying, I found another problem related to
escaping, or rather, encoding conversions. It is in the
repo-browser.

As I mentioned before, I am using https:// repository. In
the repo-browser, when I right click on a file and select
"open" from the context menu, a web browser is launched and
the corresponding URL is opened.

But, this URL has wrong encoding, at least in Japanese MS
Windows XP environment. The actual encoding used in the
URL is the native encoding (Shift JIS), whereas the
repository expects utf-8. So it fails with "404 Not Found".
The %-escaping is being performed properly, by the way.

I'll give an example.

A Japanee word for "test" has 3 multibyte characters.
In the native Shift JIS encoding it is
  0x83 0x65, 0x83 0x58, 0x83 0x67.
In UTF-8, it is
  0xe3 0x83 0x86, 0xe3 0x82 0xb9, 0xe3 0x83 0x88.

So the expected URL for something like
  https://localhost/svn/test/file.txt
is
  https://localhost/svn/%E3%83%86%E3%82%B9%E3%83%88/file.txt
(and this URL actually works when used in the web browser)
but as of TortoiseSVN 1.1.7 & 1.2.0.3333, the URL that is
shown on web browser's URL box is
  https://localhost/svn/%83e%83X%83g/file.txt
# note: %65 = 'e', %58 = 'X' and %67 = 'g'
and this fails.

The "open with" feature of TortoiseSVN 1.2.0.3333
repo-browser works correctly, by the way. I assume this is
because TortoiseSVN fetches the file to a temporary file by
itself, performing encoding conversion just before fetching.

For file:// and svn:// repositories, "open" works like "open
with" and I see no problems.

One thought that came to me while writing this mail:
It'd be nice if there is a "Copy URL" feature that puts the
URL string to the paste buffer for files and directories in
http:// repositories in repo-browser.

Thanks again

-- 
Hiroharu Tamaru
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Fri May 13 11:11:26 2005

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

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