Skip to content

Instantly share code, notes, and snippets.

@lluchs
Created July 30, 2015 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lluchs/a5e8264959623530b510 to your computer and use it in GitHub Desktop.
Save lluchs/a5e8264959623530b510 to your computer and use it in GitHub Desktop.
#!/bin/zsh
set -e
utf8() {
iconv -f ISO-8859-1 -t UTF-8 $1 > $1.tmp
mv $1.tmp $1
}
files=($(find -name '*.txt' | xargs file | grep ISO-8859 | sed 's/:.*//'))
for file in $files; do
utf8 $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment