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

Re: File names encoding

From: Michael Sinz <Michael.Sinz_at_sinz.org>
Date: 2007-01-30 12:05:23 CET

MONTEUX Eric wrote:
> I am currently developping a subversion client in C++.
> I have a problem with blank characters existing in my file names.
> The svn api says the url of such files is malformed.
> How can I encode the file names in such a way that it is considered as a
> valid url ?

URL encoding has the file name escaped as per RFC2396. This is "%xx" where
the xx is the hex code for the character. For example, "%20" would be a
space and thus a file of "one space" would be "one%20space"

All non-alpha-numeric characters or special path characters should be encoded.
See http://www.ietf.org/rfc/rfc2396.txt


> I also watched inside the tortoiseSvn source code, but I can't use it
> since I need a portable (windows / linux) implementation.

I don't remember where the function is right now (I have been playing on
the Java side a bit too much lately and know where to do it there) but
a conversion from UTF8 path into URL encoding should be readily available.

See http://www.w3.org/International/O-URL-code.html

Michael Sinz                     Technology and Engineering Director/Consultant
"Starting Startups"                                mailto:michael.sinz@sinz.org
My place on the web                            http://www.sinz.org/Michael.Sinz
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jan 30 12:06:08 2007

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