Andreas Traczyk | 3f7eb1d | 2017-12-12 11:10:27 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Andreas Traczyk | 2e10b07 | 2017-12-26 13:52:23 -0500 | [diff] [blame] | 3 | # don't fail on unknown byte sequences |
| 4 | export LC_CTYPE=C |
| 5 | |
Andreas Traczyk | 3f7eb1d | 2017-12-12 11:10:27 -0500 | [diff] [blame] | 6 | tx pull -af --minimum-perc=1 |
Andreas Traczyk | 2e10b07 | 2017-12-26 13:52:23 -0500 | [diff] [blame] | 7 | |
| 8 | if [ "$(uname)" == "Darwin" ]; then |
| 9 | option="-I" |
| 10 | else |
| 11 | option="-i" |
| 12 | fi |
| 13 | |
| 14 | for file in `find . -name '*.strings'`; do |
| 15 | # Convert file if encoding is utf-16le |
| 16 | if [ `file $option $file | awk '{print $3;}'` = "charset=utf-16le" ]; then |
| 17 | echo "Converting $file..." |
| 18 | iconv -f UTF-16LE -t UTF-8 $file > $file.8 |
| 19 | cp -f $file.8 $file |
| 20 | rm $file.8 |
| 21 | fi |
| 22 | done |