Created
March 6, 2014 05:25
-
-
Save cainanyang/9383117 to your computer and use it in GitHub Desktop.
convert text file encoding from GBK to UTF-8 in a directory
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
| cp -r src newsrc | |
| find newsrc -type f | xargs rm | |
| find src -type f | awk '{print "iconv -f gbk -t utf-8 "$1 " > new"$1}' | bash | |
| mv src srcbak | |
| mv newsrc src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment