Created
April 16, 2013 13:02
-
-
Save fedir/5395709 to your computer and use it in GitHub Desktop.
Files with non UTF8 characters in the name detecting and rename
This file contains hidden or 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
# encoding analyzing | |
find . | grep -P "[\x80-\xFF]" | iconv -f latin1 -t utf8 | |
# test launch | |
find . | grep -P "[\x80-\xFF]" | rename -n 'BEGIN {binmode STDIN, ":encoding(latin1)"; use Encode;} $_=encode("utf8", $_)' | |
# rename | |
find . | grep -P "[\x80-\xFF]" | rename -n 'BEGIN {binmode STDIN, ":encoding(latin1)"; use Encode;} $_=encode("utf8", $_)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment