cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to handle non-ASCII characters in URLs

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 9 Jan 2009 10:50:47 -0800

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

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
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