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.

[cci]rsync SOURCE SAMEFORDESTINATION –recursive –human-readable –stats –times –progress –iconv=utf8,iso88591 –delete-after[/cci]

To do the opposite change the iconv switch to: [cci]–iconv=iso88591,utf8[/cci]

Note: If you run rsync as root, you can use [cci]–owner –group[/cci] to keep the same user.group for the copied files.

Leave a Reply

Creative Commons Attribution-ShareAlike 2.5 Canada
This work by gimpe is licensed under a Creative Commons Attribution-ShareAlike 2.5 Canada.