Re: [viewvc-users] URL encoding problem
"C. Michael Pilato" <[email protected]> Tue, 25 Aug 2015 09:39:41 -0400
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.user |
|---|---|
| Organization | CollabNet, Inc. |
| Message-ID | <[email protected]> |
------=_Part_8949_1435285364.1440509987053
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 08/24/2015 11:09 AM, Serge Alexandrov wrote:
> We used SVN 1.6 + viewvc on SUSE for some years without problems.
> Now we moved to VisualSVN on Windows and I try to make viewvc work in
> the same manner.
> It works OK, but there is one problem that I can't solve.
> We have russian characters in paths. So URLs
> like http://server/viewvc/analytic/trunk/Bank/ work fine.
> But http://server/viewvc/analytic/trunk/Bank/_=D0=9E=D0=B1=D1=89=D0=B5=D0=
=B5
> <http://server/viewvc/analytic/trunk/Bank/%D0%9E%D0%B1%D1%89%D0%B5%D0%B5>=
gives
> an error:
>
>
> "An Exception Has Occurred
>
> Unknown location: /trunk/Bank/_???=EF=BF=BDN??=EF=BF=BD?=EF=BF=BD
>
> HTTP Response Status
>
> 404 Not Found"
>
> I tried 1.0.12, 1.1.23 and night build. Always the same error.
>
> The part after "Bank/" is UTF-8 characters string, not decoded.
> All the URLs on generated pages are in UTF-8, pages encoding is UTF-8.
> I know about issue #500 "ViewVC chokes on non-ASCII Subversion
> repository root name". But it's not my case, because repository root
> is standart ASCII. Anyway I made the changes from the patch, the
> problem is still there. In fact it seems to me that it's something
> with windows and unicode.. But I got stuck, and i've no more ideas...
>
ViewVC is pretty OS-agnostic as software goes. Python code using
standard modules, etc. But its functionality is limited to the quality
of the input it gets. Without knowing more, my first guess is that the
HTTP server is handing ViewVC a garbled path. If you are comfortable
hacking around in Python, you could test this theory by doing the following=
:
In the ViewVC file lib/viewvc.py, there is a bit of code (around line
178) that looks like so:
# Process PATH_INFO component of query string
path_info =3D self.server.getenv('PATH_INFO', '')
Add the following code immediately thereafter:
open('/Temp/viewvc-input.log', 'ab').write("PATH_INFO =3D %s\n" %
(path_info))
You might need to modify the path to be valid. But the idea is to have
ViewVC start logging the PATH_INFO that the web server hands it. It's
this info that ViewVC uses to translate between the URL you requested
and the repository path to which it is associated. With each incoming
request made, then, ViewVC should append that bit of debugging
information to the log file specific. You can this examine this to
determine if, in fact, the web server is providing a UTF-8-encoded path
to ViewVC (which is what is required in order for non-ASCII paths to work).
------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=3D4255&dsMessageId=3D3=
133978
To unsubscribe from this discussion, e-mail: [[email protected]=
is.org].
------=_Part_8949_1435285364.1440509987053
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<div class=3D"moz-cite-prefix">On 08/24/2015 11:09 AM, Serge
Alexandrov wrote:<br>
</div>
<blockquote cite=3D"mid:[email protected]"
type=3D"cite">
We used SVN 1.6 + viewvc on SUSE for some years without problems.<br>
Now we moved to VisualSVN on Windows and I try to make viewvc work
in the same manner.<br>
It works OK, but there is one problem that I can't solve.<br>
We have russian characters in paths. So URLs like=C2=A0<a
moz-do-not-send=3D"true"
href=3D"http://server/viewvc/analytic/trunk/Bank/">http://server/vi=
ewvc/analytic/trunk/Bank/</a>=C2=A0work
fine. But=C2=A0<a moz-do-not-send=3D"true"
href=3D"http://server/viewvc/analytic/trunk/Bank/%D0%9E%D0%B1%D1%89%D0%B5%D=
0%B5">http://server/viewvc/analytic/trunk/Bank/_=D0=9E=D0=B1=D1=89=D0=B5=D0=
=B5</a>=C2=A0gives
an error:<br>
<p><br>
"An Exception Has Occurred</p>
<p>Unknown location: /trunk/Bank/_???=EF=BF=BDN??=EF=BF=BD?=EF=BF=BD<=
/p>
<p>HTTP Response Status</p>
<p>404 Not Found"<br>
<br>
I tried 1.0.12, 1.1.23 and night build. Always the same error.<br>
<br>
The part after "Bank/" is UTF-8 characters string, not decoded.<br>
All the URLs on generated pages are in UTF-8, pages encoding is
UTF-8.<br>
I know about issue #500 "ViewVC chokes on non-ASCII Subversion
repository root name". But it's not my case, because repository
root is standart ASCII. Anyway I made the changes from the
patch, the problem is still there. In fact it seems to me that
it's something with windows and unicode.. But I got stuck, and
i've no more ideas...</p>
</blockquote>
<br>
ViewVC is pretty OS-agnostic as software goes.=C2=A0 Python code using
standard modules, etc.=C2=A0 But its functionality is limited to the
quality of the input it gets.=C2=A0 Without knowing more, my first gues=
s
is that the HTTP server is handing ViewVC a garbled path.=C2=A0 If you
are comfortable hacking around in Python, you could test this theory
by doing the following:<br>
<br>
In the ViewVC file lib/viewvc.py, there is a bit of code (around
line 178) that looks like so:<br>
<br>
<tt>=C2=A0=C2=A0=C2=A0 # Process PATH_INFO component of query string</t=
t><tt><br>
</tt><tt>=C2=A0=C2=A0=C2=A0 path_info =3D self.server.getenv('PATH_INFO=
', '')</tt><br>
<br>
Add the following code immediately thereafter:<br>
<br>
<tt>=C2=A0=C2=A0=C2=A0 open('/Temp/viewvc-input.log', 'ab').write("PATH=
_INFO =3D
%s\n" % (path_info))</tt><br>
<br>
You might need to modify the path to be valid.=C2=A0 But the idea is to
have ViewVC start logging the PATH_INFO that the web server hands
it.=C2=A0 It's this info that ViewVC uses to translate between the URL
you requested and the repository path to which it is associated.=C2=A0
With each incoming request made, then, ViewVC should append that bit
of debugging information to the log file specific.=C2=A0 You can this
examine this to determine if, in fact, the web server is providing a
UTF-8-encoded path to ViewVC (which is what is required in order for
non-ASCII paths to work).<br>
</body>
</html>
------=_Part_8949_1435285364.1440509987053--