Skip to content

Instantly share code, notes, and snippets.

@shepherdwind
Created April 10, 2014 04:00
Show Gist options
  • Save shepherdwind/10341512 to your computer and use it in GitHub Desktop.
Save shepherdwind/10341512 to your computer and use it in GitHub Desktop.
convert all file to utf8
#!/bin/bash
FROM=gbk
TO=UTF-8
ICONV="iconv -f $FROM -t $TO"
# Convert
find . -type f -name "*" | while read fn; do
cp ${fn} ${fn}.bak
$ICONV < ${fn}.bak > ${fn}
rm ${fn}.bak
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment