2013-09-20 22:32:05 +00:00
|
|
|
#!/bin/sh
|
2011-02-03 19:27:49 +00:00
|
|
|
#
|
|
|
|
# Check for UTF-8 problems in all files where they might appear
|
|
|
|
# Also check all Java source files
|
|
|
|
# Returns nonzero on failure
|
|
|
|
#
|
|
|
|
# zzz 2010-12
|
|
|
|
# public domain
|
|
|
|
#
|
|
|
|
|
|
|
|
cd `dirname $0`/../..
|
|
|
|
|
|
|
|
# apps/routerconsole/jsp/ should only have UTF8 in help_xx.jsp
|
|
|
|
|
|
|
|
DIRS="\
|
|
|
|
apps/routerconsole/locale \
|
2013-10-14 15:29:12 +00:00
|
|
|
apps/routerconsole/locale-news \
|
|
|
|
apps/routerconsole/locale-countries \
|
2011-02-03 19:27:49 +00:00
|
|
|
apps/i2ptunnel/locale \
|
2013-10-14 15:29:12 +00:00
|
|
|
apps/i2ptunnel/locale-proxy \
|
2011-02-03 19:27:49 +00:00
|
|
|
apps/i2psnark/locale \
|
2014-06-23 20:10:11 +00:00
|
|
|
apps/ministreaming/locale \
|
2011-02-03 19:27:49 +00:00
|
|
|
apps/susidns/locale \
|
2011-03-19 16:37:53 +00:00
|
|
|
apps/susimail/locale \
|
2011-02-03 19:27:49 +00:00
|
|
|
apps/desktopgui/locale \
|
2011-06-26 19:07:01 +00:00
|
|
|
debian/po \
|
2012-03-15 14:51:34 +00:00
|
|
|
installer/resources/eepsite/docroot/help \
|
2011-02-03 19:27:49 +00:00
|
|
|
installer/resources/initialNews \
|
|
|
|
installer/resources/proxy \
|
|
|
|
installer/resources/readme \
|
|
|
|
apps/routerconsole/jsp \
|
|
|
|
apps/i2ptunnel/jsp \
|
|
|
|
apps/susidns/src/jsp"
|
|
|
|
|
|
|
|
for i in `find $DIRS -maxdepth 1 -type f`
|
|
|
|
do
|
2018-05-03 13:00:08 +00:00
|
|
|
#echo "Checking $i ..."
|
2019-05-10 22:22:57 +00:00
|
|
|
iconv -f UTF8 -t UTF8 $i > /dev/null
|
2011-02-03 19:27:49 +00:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "********* FAILED CHECK FOR $i *************"
|
|
|
|
FAIL=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2018-05-03 13:00:08 +00:00
|
|
|
echo "Checking all Java and Scala files ..."
|
|
|
|
for i in `find . \( -name \*.java -o -name \*.scala \) -type f`
|
2011-02-03 19:27:49 +00:00
|
|
|
do
|
|
|
|
#echo "Checking $i ..."
|
2019-05-10 22:22:57 +00:00
|
|
|
iconv -f UTF8 -t UTF8 $i > /dev/null
|
2018-05-03 13:00:08 +00:00
|
|
|
if [ $? -ne 0 ]
|
2011-02-03 19:27:49 +00:00
|
|
|
then
|
|
|
|
echo "********* FAILED CHECK FOR $i *************"
|
|
|
|
FAIL=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2018-02-23 16:35:16 +00:00
|
|
|
# Java properties files (when not using our DataHelper methods) must be ISO-8859-1
|
|
|
|
# https://docs.oracle.com/javase/6/docs/api/java/util/Properties.html
|
2014-04-01 12:59:27 +00:00
|
|
|
echo "Checking getopt properties files ..."
|
|
|
|
for i in `find core/java/src/gnu/getopt -name \*.properties -type f`
|
|
|
|
do
|
|
|
|
#echo "Checking $i ..."
|
2019-05-10 22:22:57 +00:00
|
|
|
iconv -f ISO-8859-1 -t ISO-8859-1 $i > /dev/null
|
2014-04-01 12:59:27 +00:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "********* FAILED CHECK FOR $i *************"
|
|
|
|
FAIL=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2011-02-03 19:27:49 +00:00
|
|
|
if [ "$FAIL" != "" ]
|
|
|
|
then
|
|
|
|
echo "******** At least one file failed check *********"
|
|
|
|
else
|
|
|
|
echo "All files passed"
|
|
|
|
fi
|
|
|
|
exit $FAIL
|