cURL / Mailing Lists / curl-users / Single Mail

curl-users

FTP support for UTF8 characters in filename on Windows

From: Vincent Lavoie <yota_1998_at_yahoo.com>
Date: Thu, 17 Feb 2011 10:40:44 -0800 (PST)

Hello
 
On Windows, I'm trying to download a file that contains foreign characters
(non-ascii) in FILENAME like « é » via CURL.EXE (v. 7.21.3) from a FTPS site. If
I do the command "List", all the foreign characters of the filenames are bad …
 
I know that the FTP site support UTF8 and the files are listed correctly with
another FTP program like Filezilla but I cannot find how to do that with
CURL.EXE.
 
For all files without foreign character, the script work very well.
 
I call CURL from a batch file and here is my code :
 
Rem redirect FTP list to file "dir.txt"
curl -Q "PROT P" -ku myusername:mypassword ftps://dbs.ftpsite.com/ -l > dir.txt
 
Rem for each line download the file
FOR /F "delims=¶" %%i IN (dit.txt) DO (
      echo.
      echo === Transfering %%i
      curl --stderr - -o ".\Inbox\%%i" -Q "PROT P" -Q "OPTS UTF8 ON" -ku
myusername:mypassword "ftps://dbs.ftpsite.com/%%i" > error.txt
      […]
)
 
Someone can help me with this please ? I took many hours to search for an answer
everywhere without success...
 
 
Thanks in advance for your support

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-17