Tip: use rsync to convert filenames from/to UTF-8 latin-1/ISO-8859-1

This will copy files with UTF-8 encoded characters filenames to new files with a ISO-8859-1 encoded filenames and, when everything is completed, will delete the old (UTF-8) files.

BE CAREFUL THIS IS NOT FOOL PROOF 🙂 YOU MUST KNOW WHAT YOU ARE DOING TO NOT DOUBLE ENCODE THE CHARACTERS FILENAMES.

rsync SOURCE SAMEFORDESTINATION --recursive --human-readable --stats --times --progress --iconv=utf8,iso88591 --delete-after

To do the opposite change the iconv switch to: --iconv=iso88591,utf8

Note: If you run rsync as root, you can use --owner --group to keep the same user.group for the copied files.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.