source: tests/scripts/checkutf8.sh @ 3ec6028

Last change on this file since 3ec6028 was 3ec6028, checked in by zzz <zzz@…>, 8 years ago
  • Translations: Move country names to a new resource bundle
  • Property mode set to 100755
File size: 1.3 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/susidns/locale \
23  apps/susimail/locale \
24  apps/desktopgui/locale \
25  debian/po \
26  installer/resources/eepsite/docroot/help \
27  installer/resources/initialNews \
28  installer/resources/proxy \
29  installer/resources/readme \
30  apps/routerconsole/jsp \
31  apps/i2ptunnel/jsp \
32  apps/susidns/src/jsp"
33
34for i in `find $DIRS -maxdepth 1 -type f`
35do
36        echo "Checking $i ..."
37        iconv -f UTF8 -t UTF8 $i -o /dev/null
38        if [ $? -ne 0 ]
39        then
40                echo "********* FAILED CHECK FOR $i *************"
41                FAIL=1
42        fi
43done
44
45echo "Checking all Java files ..."
46for i in `find . -name \*.java -type f`
47do
48        #echo "Checking $i ..."
49        iconv -f UTF8 -t UTF8 $i -o /dev/null
50        if [ $? -ne 0 ]
51        then
52                echo "********* FAILED CHECK FOR $i *************"
53                FAIL=1
54        fi
55done
56
57if [ "$FAIL" != "" ]
58then
59        echo "******** At least one file failed check *********"
60else
61        echo "All files passed"
62fi
63exit $FAIL
Note: See TracBrowser for help on using the repository browser.