cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to handle non-ASCII characters in URLs

From: G. T. Stresen-Reuter <tedmasterweb_at_gmail.com>
Date: Sat, 10 Jan 2009 12:10:26 +0000

The saga continues ;-)

On Jan 10, 2009, at 12:44 AM, Dan Fandrich wrote:

> On Fri, Jan 09, 2009 at 11:40:38PM +0000, G. T. Stresen-Reuter wrote:
>> An abbreviated sample of the command I'm using is:
>>
>> curl -s -u "user:pass" "ftp://domain.com/dir/" -Q "DELE /dir/
>> espaņa.txt"
>> -v
>>
>> I'm confused by how much of the path I have to include in the
>> "ftp://"
>> part and how much needs to be in the "DELE" part, and what the
>> difference
>> is between the two.
>
> The -v option will show you when the various commands are sent in the
> protocol session. You'll see that a regular -Q command is sent
> before the
> CWD to change directories, while a -Q with a - prefix is sent after.
> So
> if you use -DELE you don't need to specify the path name.
>
> Note also that a URL of ftp://domain.com/dir/foo.txt corresponds to
> -Q "DELE dir/foo.txt" not "DELE /dir/espaņa.txt" and are likely to
> refer to
> different files. The latter corresponds to a URL of
> ftp://domain.com//dir/foo.txt
>
>>
> Dan

Excellent clarifications! Thank you for the help.

FWIW, I turned on my local FTP server and tried the same commands
locally. I was able to do everything I wanted and everything worked as
expected, so I've isolated the issue to having something to do with
character encoding between platforms (Mac OS X Leopard and Debian) or
possibly via firewalls (unlikely).

Ted

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-01-10