Rsync transfer Filename Character Encoding Problem (accents etc)

117 Views Asked by At

Transferring my large web site I have transferred a lot of photo files between two Linux servers using rsync. Going from Centos 7 to CloudLinux so both Linux.

Example of file name on old server

Suppiluliuma_II_Grabkammer_S?dburg_Hattusa_Fot.png

after transfer

Suppiluliuma_II_Grabkammer_S%C3%BCdburg_Hattusa_Fot.png

Also in the new host's web based file manager the file is showing up as

Suppiluliuma_II_Grabkammer_S�dburg_Hattusa_Fot.png

and won't display properly

I know this is not good practice to have files encoded like this but they have been uploaded by web site contributors in the past so I'm stuck with them.

I can transfer the files again but how do I stop this happening? I have tried -s and this doesn't help. I have seen the rsync --iconv option but don't know how to use it.

Or is there a better way to transfer and make sure all the files go across?

PS I have just tried SFTP with Filezilla and its interface complains about the encoding of this file (before transfer) and won't even display it!

PPS I don't know if this is fixable with rsync. So I'm going to try the transfer again by creating a zip file / tarball , uploading that and unzipping into the correct directory.

1

There are 1 best solutions below

0
Megalithic On

It turned out we had files in ISO-8859-1 format.

--iconv as follows fixed the transfer problem:

rsync -av --iconv=UTF-8,ISO-8859-1 /PATH_TO_OLD/ /PATH_TO_NEW/