source: tests/scripts/checkutf8.sh @ e71d1d38

Last change on this file since e71d1d38 was e71d1d38, checked in by zzz <zzz@…>, 3 years ago

Getopt: Add new translations
Add instructions in .tx/config for conversion
Fix checkutf8.sh for getopt translations

  • Property mode set to 100755
File size: 1.8 KB
Line 
1#!/bin/sh
2#
3# Check for UTF-8 problems in all files where they might appear
4# Also check all Java source files
5# Returns nonzero on failure
6#
7# zzz 2010-12
8# public domain
9#
10
11cd `dirname $0`/../..
12
13# apps/routerconsole/jsp/ should only have UTF8 in help_xx.jsp
14
15DIRS="\
16  apps/routerconsole/locale \
17  apps/routerconsole/locale-news \
18  apps/routerconsole/locale-countries \
19  apps/i2ptunnel/locale \
20  apps/i2ptunnel/locale-proxy \
21  apps/i2psnark/locale \
22  apps/ministreaming/locale \
23  apps/susidns/locale \
24  apps/susimail/locale \
25  apps/desktopgui/locale \
26  debian/po \
27  installer/resources/eepsite/docroot/help \
28  installer/resources/initialNews \
29  installer/resources/proxy \
30  installer/resources/readme \
31  apps/routerconsole/jsp \
32  apps/i2ptunnel/jsp \
33  apps/susidns/src/jsp"
34
35for i in `find $DIRS -maxdepth 1 -type f`
36do
37        echo "Checking $i ..."
38        iconv -f UTF8 -t UTF8 $i -o /dev/null
39        if [ $? -ne 0 ]
40        then
41                echo "********* FAILED CHECK FOR $i *************"
42                FAIL=1
43        fi
44done
45
46echo "Checking all Java files ..."
47for i in `find . -name \*.java -type f`
48do
49        #echo "Checking $i ..."
50        iconv -f UTF8 -t UTF8 $i -o /dev/null
51        if [ $? -ne 0 ]
52        then
53                echo "********* FAILED CHECK FOR $i *************"
54                FAIL=1
55        fi
56done
57
58# Java properties files (when not using our DataHelper methods) must be ISO-8859-1
59# https://docs.oracle.com/javase/6/docs/api/java/util/Properties.html
60echo "Checking getopt properties files ..."
61for i in `find core/java/src/gnu/getopt -name \*.properties -type f`
62do
63        #echo "Checking $i ..."
64        iconv -f ISO-8859-1 -t ISO-8859-1 $i -o /dev/null
65        if [ $? -ne 0 ]
66        then
67                echo "********* FAILED CHECK FOR $i *************"
68                FAIL=1
69        fi
70done
71
72if [ "$FAIL" != "" ]
73then
74        echo "******** At least one file failed check *********"
75else
76        echo "All files passed"
77fi
78exit $FAIL
Note: See TracBrowser for help on using the repository browser.