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: Fri, 9 Jan 2009 23:40:38 +0000

On Jan 9, 2009, at 8:26 PM, Dan Fandrich wrote:

> On Fri, Jan 09, 2009 at 08:12:58PM +0000, G. T. Stresen-Reuter wrote:
>> Ok, I increased logging on the server and can see that the filename
>> is
>> being transferred correctly (or what appears to be correctly to
>> me). The
>> following logs show:
>>
>> 1. Transferring both test files to the server via CyberDuck
>> 2. Deleting test.txt via my bash script and curl
>> 3. Failing to delete espaņa.txt via my bash script and curl
>>
>> [09/Jan/2009:20:10:08 +0000] STOR test.txt 226 - STOR test.txt
>> [09/Jan/2009:20:10:11 +0000] STOR espaņa.txt 226 - STOR espaņa.txt
>> [09/Jan/2009:20:10:31 +0000] RETR httpdocs/samples/test.txt 226 -
>> RETR
>> httpdocs/samples/test.txt
>> [09/Jan/2009:20:10:32 +0000] DELE /httpdocs/samples/test.txt 250 -
>> DELE
>> /httpdocs/samples/test.txt
>> [09/Jan/2009:20:10:38 +0000] RETR httpdocs/samples/espaņa.txt 550 -
>> RETR
>> httpdocs/samples/espaņa.txt
>>
>> What in the world am I doing wrong and what additional logging can I
>> enable to figure it out???
>
> You're showing accesses to three potentially different directories
> in that
> log. Try first getting an operation working on an ASCII file then
> switch to
> an i18n file. Maybe the use of --ftp-method is confusing the
> server, too.
>
>>
> Dan

Dan,

I understand what you mean, but I suspect the directories aren't the
issue as I appear to be able to do everything I want with the test.txt
file using the same exact curl command and changing only the file name.

But since we're on the subject, there has been something that's been
making me wonder that you may be able to help with.

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.

FWIW, I'm pretty sure I'm including the ftp:// because I couldn't
trigger the FTP connection method any other way (it kept defaulting to
HTTP).

Back to the main topic, though...

I've tried this same command from a couple different computers now and
it simply doesn't work. Hasn't anyone else run into the same problem?

And FWIW, the server I'm trying to connect to does not return the
encoding, saddly, and since this will be part of a production system
that will be connecting with arbitrary servers, there's really no way
I can require such a thing (but I'm more than happy to say "too bad"
if it doesn't work after having exhausted the curl options).

Again, I appreciate any help anyone can provide and will report the
solution to the list when I find one.

And I keep forgetting to post this, I'm using these versions of curl:

curl 7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/
1.2.3.3 libidn/1.1
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

curl 7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l
zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: GSS-Negotiate IPv6 Largefile NTLM SSL libz

Ted Stresen-Reuter
http://tedmasterweb.com

-------------------------------------------------------------------
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