- Add UTF-8 test script

- Fix non-UTF-8 comment in Jetty source File
This commit is contained in:
zzz
2011-02-03 19:27:49 +00:00
parent b502fd0e9d
commit c979d65ee6
2 changed files with 58 additions and 1 deletions

View File

@ -47,7 +47,7 @@ import org.mortbay.util.URI;
* HTTP/1.1 ranges are supported.
*
* @version $Id: ResourceHandler.java,v 1.66 2005/08/24 08:18:17 gregwilkins Exp $
* @author Nuno Pregui<EFBFBD>a
* @author Nuno Pregui?a (sorry, wasn't UTF-8)
* @author Greg Wilkins
*/
public class ResourceHandler extends AbstractHttpHandler

57
tests/scripts/checkutf8.sh Executable file
View File

@ -0,0 +1,57 @@
#
# 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 \
apps/i2ptunnel/locale \
apps/i2psnark/locale \
apps/susidns/locale \
apps/desktopgui/locale \
installer/resources/eepsite.help/help \
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
echo "Checking $i ..."
iconv -f UTF8 -t UTF8 $i -o /dev/null
if [ $? -ne 0 ]
then
echo "********* FAILED CHECK FOR $i *************"
FAIL=1
fi
done
echo "Checking all Java files ..."
for i in `find . -name \*.java -type f`
do
#echo "Checking $i ..."
iconv -f UTF8 -t UTF8 $i -o /dev/null
if [ $? -ne 0 ]
then
echo "********* FAILED CHECK FOR $i *************"
FAIL=1
fi
done
if [ "$FAIL" != "" ]
then
echo "******** At least one file failed check *********"
else
echo "All files passed"
fi
exit $FAIL