From c979d65ee6acb4b96250c58598ba9f4b317b8c7d Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Thu, 3 Feb 2011 19:27:49 +0000 Subject: [PATCH] - Add UTF-8 test script - Fix non-UTF-8 comment in Jetty source File --- .../mortbay/http/handler/ResourceHandler.java | 2 +- tests/scripts/checkutf8.sh | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100755 tests/scripts/checkutf8.sh diff --git a/apps/jetty/java/src/org/mortbay/http/handler/ResourceHandler.java b/apps/jetty/java/src/org/mortbay/http/handler/ResourceHandler.java index 5515df2269..d1a57159bf 100644 --- a/apps/jetty/java/src/org/mortbay/http/handler/ResourceHandler.java +++ b/apps/jetty/java/src/org/mortbay/http/handler/ResourceHandler.java @@ -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Ƨa + * @author Nuno Pregui?a (sorry, wasn't UTF-8) * @author Greg Wilkins */ public class ResourceHandler extends AbstractHttpHandler diff --git a/tests/scripts/checkutf8.sh b/tests/scripts/checkutf8.sh new file mode 100755 index 0000000000..8efce06bf6 --- /dev/null +++ b/tests/scripts/checkutf8.sh @@ -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 -- GitLab