Skip to content

Instantly share code, notes, and snippets.

@jlbfalcao
Created June 17, 2013 13:18
Show Gist options
  • Save jlbfalcao/5796791 to your computer and use it in GitHub Desktop.
Save jlbfalcao/5796791 to your computer and use it in GitHub Desktop.
converting all files from us-ascii to utf-8
find path -type f | xargs file --mime-encoding | grep us-ascii | cut -d: -f 1 | while read f; do
mv $f{,.ascii}
echo $f
iconv -f UTF-8 -t US-ASCII $f.ascii > $f
rm $f.ascii
# git add $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment