Skip to content

Instantly share code, notes, and snippets.

@sh1nj1
Created November 3, 2015 01:04
Show Gist options
  • Save sh1nj1/93b45e3dd95ddb7d15a9 to your computer and use it in GitHub Desktop.
Save sh1nj1/93b45e3dd95ddb7d15a9 to your computer and use it in GitHub Desktop.
update file encoding
find ./ -name "*.sql" -exec file -i {} \; | grep "charset=iso-8859-1" | cut -d':' -f1 | while read a; do iconv -c -f euc-kr -t utf-8 $a > "$a-utf8.sql"; cat "$a-utf8.sql" > "$a"; rm "$a-utf8.sql"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment