Created
March 25, 2013 16:22
-
-
Save x2q/5238377 to your computer and use it in GitHub Desktop.
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/sh | |
| # Recodes specified file to UTF-8, except if it seems to be UTF-8 already | |
| result=`grep -c [åäöÅÄÖ] $1` | |
| if [ "$result" -eq "0" ] | |
| then | |
| echo "Recoding $1 from ISO-8859-1 to UTF-8" | |
| recode ISO-8859-1..UTF-8 $1 # overwrites file | |
| else | |
| echo "$1 was already UTF-8 (probably); skipping it" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment