source: tests/scripts/checkutf8.sh @ c979d65

Last change on this file since c979d65 was c979d65, checked in by zzz <zzz@…>, 10 years ago
  • Add UTF-8 test script
  • Fix non-UTF-8 comment in Jetty source File
  • Property mode set to 100755
File size: 1.2 KB
Line 
1#
2# Check for UTF-8 problems in all files where they might appear
3# Also check all Java source files
4# Returns nonzero on failure
5#
6# zzz 2010-12
7# public domain
8#
9
10cd `dirname $0`/../..
11
12# apps/routerconsole/jsp/ should only have UTF8 in help_xx.jsp
13
14DIRS="\
15  apps/routerconsole/locale \
16  apps/i2ptunnel/locale \
17  apps/i2psnark/locale \
18  apps/susidns/locale \
19  apps/desktopgui/locale \
20  installer/resources/eepsite.help/help \
21  installer/resources/initialNews \
22  installer/resources/proxy \
23  installer/resources/readme \
24  apps/routerconsole/jsp \
25  apps/i2ptunnel/jsp \
26  apps/susidns/src/jsp"
27
28for i in `find $DIRS -maxdepth 1 -type f`
29do
30        echo "Checking $i ..."
31        iconv -f UTF8 -t UTF8 $i -o /dev/null
32        if [ $? -ne 0 ]
33        then
34                echo "********* FAILED CHECK FOR $i *************"
35                FAIL=1
36        fi
37done
38
39echo "Checking all Java files ..."
40for i in `find . -name \*.java -type f`
41do
42        #echo "Checking $i ..."
43        iconv -f UTF8 -t UTF8 $i -o /dev/null
44        if [ $? -ne 0 ]
45        then
46                echo "********* FAILED CHECK FOR $i *************"
47                FAIL=1
48        fi
49done
50
51if [ "$FAIL" != "" ]
52then
53        echo "******** At least one file failed check *********"
54else
55        echo "All files passed"
56fi
57exit $FAIL
Note: See TracBrowser for help on using the repository browser.