Skip to content

Instantly share code, notes, and snippets.

@xdtianyu
Created April 13, 2015 02:54
Show Gist options
  • Save xdtianyu/a2d6f291fa3dabb8bdf3 to your computer and use it in GitHub Desktop.
Save xdtianyu/a2d6f291fa3dabb8bdf3 to your computer and use it in GitHub Desktop.
Usage: GB2312-UTF8.sh [directory name]
#!/bin/bash
#Usage: GB2312-UTF8.sh [directory name]
DIR=$1
cd $DIR
mkdir utf8
for file in *.txt ; do
echo $file
iconv -f GB18030 -t UTF-8 $file > utf8/$file
done
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment