Last active
September 29, 2017 14:24
-
-
Save InFog/d16dc78146965dd7203b11fe11d0cfb8 to your computer and use it in GitHub Desktop.
This file contains 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 | |
FILE="$1" | |
TMP_FILE="$FILE.tmp" | |
if [ -f "$FILE" ]; then | |
IS_ISO=$(file -I "$FILE" | grep 8859) | |
if [ -n "$IS_ISO" ]; then | |
iconv -f iso-8859-1 -t utf-8 "$FILE" > "$TMP_FILE" | |
mv "$TMP_FILE" "$FILE" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment