cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Quotes around spaces not working

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sat, 20 Aug 2005 13:18:33 +0200 (CEST)

On Sat, 20 Aug 2005, Owen Watson wrote:

> It does work no problem. However, the program I am using just passes a bare
> filepath, which may contain spaces, to curl, so I'm unable to do a
> substitution. There's a bit somewhere on the curl site about parameters
> containing spaces needing quotes round them; this doesn't seem to work.

Uh, it does work. Using quotes makes your command line pass on those spaces to
curl.

It doesn't encoded them into a suitable URL however, but I don't think any
curl docs suggests that.

> I suppose the program could call a batch file, but (a) I don't know much
> about string manipulation in batch files, and (b) the batch file would still
> see a variable number of parameters rather than one big parameter.

Yes, you would need to make sure that you pass on a valid URL to curl.

We have several times been talking about adding an option that does the
necessary encoding, but no one has yet written it. See Kevin Roth's soon two
years old suggestion:

         http://curl.haxx.se/mail/archive-2003-11/0091.html

I would gladly accept patches that provide this feature.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-08-20