Created
February 18, 2019 17:59
-
-
Save Albirew/80135a51942c37d4c8a3708d67da23a1 to your computer and use it in GitHub Desktop.
rename files with shitty windows-1252 characters into normal format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find -name *é* -exec rename 's/é/é/g' '{}' \; | |
find -name *è* -exec rename 's/è/è/g' '{}' \; | |
find -name *ç* -exec rename 's/ç/ç/g' '{}' \; | |
find -name *Ã * -exec rename 's/Ã /à/g' '{}' \; | |
find -name *ù* -exec rename 's/ù/ù/g' '{}' \; | |
find -name *ø* -exec rename 's/ø/ø/g' '{}' \; | |
find -name *â* -exec rename 's/â/â/g' '{}' \; | |
find -name *ë* -exec rename 's/ë/ë/g' '{}' \; | |
find -name *ÿ* -exec rename 's/ÿ/ÿ/g' '{}' \; | |
find -name *î* -exec rename 's/î/î/g' '{}' \; | |
find -name *ô* -exec rename 's/ô/ô/g' '{}' \; | |
# double escape for ? else it will be treated as regex expression | |
find -name *Ã?* -exec rename 's/Ã\\?/É/g' '{}' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment