Linux – What do I need to do to rsync on Windows to make it keep special characters in filenames on Linux

character encodinglinuxrsyncwindows

We're in the process of implementing an offsite backup of all our servers to a remote Linux server. We're using rsync over SSH. What I've found is that characters such as ñ, ö, ô and ã are replaced on the Linux server with underscores. I don't mind if it changes these characters in the filenames of documents, but when it renames a language pack from Español.clx to Espa_ol.clx, it could cause issues for us further down the line.

My current command-line is:

rsync -v -rlt -z --chmod=a=rw,Da+x -u --delete -e "ssh -i <keyfile>" <source> <destination>

What do I need to do differently to make the special characters copy over correctly?

EDIT: For the initial sync which will take place locally, before the machine is moved offsite, I have SAMBA enabled. I am able to copy files from Windows to the Samba share, retaining the original filename, though it looks different in the Linux directory listing, i.e. têst becomes têst.
These files get deleted by rsync when it runs, as it does not match the filenames.

Best Answer

Adding the parameter

--iconv=ISO-8859-1,utf-8

seems to have sorted the problem out.

Related Question