Last active
August 29, 2015 14:05
-
-
Save devxoul/9e54a29ce0b855bad2ed to your computer and use it in GitHub Desktop.
Convert `Localizable.strings` file encoding to such encoding.
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/sh | |
ENCODING="utf-8" | |
for file in *.lproj/Localizable.strings; do | |
charset=`file -I "$file" | sed 's/.*charset=\(.*\)/\1/'` | |
if ! [[ "$charset" =~ "$ENCODING" ]] | |
then | |
output="$file.tmp" | |
iconv -f "$charset" -t "$ENCODING" "$file" > "$output" && | |
rm "$file" && | |
mv "$output" "$file" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment