Created
May 25, 2015 03:39
-
-
Save becxer/6a65e06bcab6fd202ee9 to your computer and use it in GitHub Desktop.
convert_encoding.sh (convert files encoding batch)
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
#!/bin/bash | |
FROM=UTF-16 | |
TO=UTF-8 | |
ICONV="iconv -f $FROM -t $TO" | |
# Convert | |
find ./ -type f -name "*.txt" | 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