curl-users
Re: How to handle non-ASCII characters in URLs
Date: Fri, 9 Jan 2009 20:12:58 +0000
On Jan 9, 2009, at 6:50 PM, Dan Fandrich wrote:
> On Fri, Jan 09, 2009 at 05:50:50PM +0000, G. T. Stresen-Reuter wrote:
>> If I am trying to delete a file named "espaņa.txt", what would the
>> curl
>> command look like?
>>
>> curl -u "user:password" "ftp://domain.com/espa%f1a.txt" -Q "dele /
>> espaņa.txt"
>>
>> The above returns a FTP 550 error.
>>
>> I assume the "ņ" needs to be percent encoded, but I was hoping for
>> some
>> confirmation/enlightenment before heading down that path with my
>> script.
>
> RFC2640 standardizes internationalized pathnames for FTP and states
> that
> compliant servers will support UTF-8. This means that the URL
> ftp://domain.com/espa%c3%b1a.txt will work for those servers.
> Noncompliant
> servers could user other encodings. For ISO-8859-1, the URL
> ftp://domain.com/espa%f1a.txt should work. Some servers could
> support detect
> the coding and support both.
>
>>
> Dan
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???
Thanks again for all your help in advance.
Sincerely,
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-09