Created
November 28, 2013 17:52
-
-
Save wfaler/7695870 to your computer and use it in GitHub Desktop.
Note on how to change files to UTF-8 encoding regardless of original encoding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TMPFILE="utf8.tmp" | |
cp $1 $TMPFILE | |
enc=`file -i $1 | awk 'BEGIN {FS = "="} ; {print $2; }'` # gets encoding of a file | |
iconv -f $enc -t utf-8 $TMPFILE > $1 # changes encoding to UTF-8 | |
rm $TMPFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment