Skip to content

Instantly share code, notes, and snippets.

@cainanyang
Created March 6, 2014 05:25
Show Gist options
  • Save cainanyang/9383117 to your computer and use it in GitHub Desktop.
Save cainanyang/9383117 to your computer and use it in GitHub Desktop.
convert text file encoding from GBK to UTF-8 in a directory
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