Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a crappy webhoster where I need the filenames in iso-8859-1, my FS uses utf-8. Filezilla can handle encodings, but I need something that I can use in a script. Is there a program out there that I can use to convert file names on upload that can be called from bash?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I think there are ways to script FileZilla but I'm not too familiar with them. Try that first.

If not, what I can suggest is using lftp instead. With lftp you can do the following:

set file:charset iso8859-1

and from there, upload the file.

Hope that helps!

share|improve this answer
    
Nope, you can't script filezilla from the command line. –  Tass Mar 4 '12 at 21:56
    
That should be ftp:charset. –  Tass Mar 4 '12 at 22:17
    
Thanks Tass for your input. –  Carlos Mar 4 '12 at 22:54
convmv --notest -r -t iso8859-1 ./upload-queue/

Alternatively, hack something up using iconv.

srcfile=...
dstfile=$(echo "$srcfile" | iconv -t iso8859-1)

some-upload-command "$srcfile" "ftpserver:$dstfile"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.