source: tests/scripts/checkutf8.sh @ d9ba62a

Last change on this file since d9ba62a was d9ba62a, checked in by kytv <kytv@…>, 10 years ago

Update paths, add new files

  • 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/susimail/locale \
20  apps/desktopgui/locale \
21  debian/po \
22  installer/resources/eepsite/docroot/help \
23  installer/resources/initialNews \
24  installer/resources/proxy \
25  installer/resources/readme \
26  apps/routerconsole/jsp \
27  apps/i2ptunnel/jsp \
28  apps/susidns/src/jsp"
29
30for i in `find $DIRS -maxdepth 1 -type f`
31do
32        echo "Checking $i ..."
33        iconv -f UTF8 -t UTF8 $i -o /dev/null
34        if [ $? -ne 0 ]
35        then
36                echo "********* FAILED CHECK FOR $i *************"
37                FAIL=1
38        fi
39done
40
41echo "Checking all Java files ..."
42for i in `find . -name \*.java -type f`
43do
44        #echo "Checking $i ..."
45        iconv -f UTF8 -t UTF8 $i -o /dev/null
46        if [ $? -ne 0 ]
47        then
48                echo "********* FAILED CHECK FOR $i *************"
49                FAIL=1
50        fi
51done
52
53if [ "$FAIL" != "" ]
54then
55        echo "******** At least one file failed check *********"
56else
57        echo "All files passed"
58fi
59exit $FAIL
Note: See TracBrowser for help on using the repository browser.