Amper 1.5 build: 9123 released: 2007-06-30 Converts & to & in html. Copyright (c) 2008 Canadian Mind Products. Java application. Download from http://mindprod.com/products1.html#AMPER ===> Free <=== Full source included. You may even include the source code, modified or unmodified in commercial programs that you write and distribute. May be used freely for any purpose but military. For more details on this restriction, see http://mindprod.com/roedy.html#NONMILITARY If you include any Canadian Mind Products code in your own applications, your app too must be labeled non-military use only. All Java jars and source code are included. ---- Prerequisites: This program runs under any OS, (e.g. Win2K/XP/Vista/OSX/Linux/Solaris/Vista64/AIX...) so long as you have <><> Java version 1.5 <><> or later installed. See http://mindprod.com/jgloss/installingjava.html for details. ---- Installing: Download source and compiled class files to run on your own machine as an application. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. To install, extract the zip download with Winzip (or similar unzip utility) into any directory you please, often J:\ -- ticking off the “user folder names” option. To run as an application,type: java -jar J:\com\mindprod\amper\amper.jar parms adjusting as necessary to account for where the jar file is. ---- Rebuilding: The zip already contains the necessary class and jar files, so unless you modify the program, there is no need to recompile the source or rebuild the jar. Configure basedir="E:/" in rebuild.xml to the drive where your files are. Use ANT and rebuild.xml, not build.xml, to recompile and recreate the jar. ---- Use: Converts & to & in HTML files, but does not convert it when the & is already in an entity e.g. < ϑ é The main use for this is to pass HTMLValidator verification of your HTML, which is very picky about &, especially inside URLs. As a side effect, it also ensures all your balance. It does not change & inside comments, though it will change it inside href= and image= urls, or anywhere else e.g. Java Applet parameters, which is correct according to the HTMLValidator. It does _not_ change " to " < to < or é to é It just fixes &, the most troublesome character. To convert a single file, type: java -jar C:\com\mindprod\amper\amper.jar myfile.html The results replace the old file, so you had better make a backup just in case this is not what you want. You can also list several files on the command line: java -jar C:\com\mindprod\amper\amper.jar myfile.html C:\mydir\another.html To use convert the current directory of HTML files: java -jar C:\com\mindprod\amper\amper.jar . Sorry no wildcards, just . , and .. DON'T USE WILDCARDS unless you deeply understand how they work. See http://mindprod.com/jgloss/wildcard.html. Windows expands them, not amper, and feeds them to amper (or any other program) as a giant list of all the directories and files in the current directory. Amper will thus tend process all the files in your directories, when you just meant to process the files in the current directory. The -s switch makes all subsequent directories searched recursively to include all their subdirectories. e.g. java -jar C:\com\mindprod\amper\amper.jar E:\mindprod will fix all *.html files in the mindprod directory tree, ignoring other types of files. The -q option switch suppresses much of the output. If you have the jar extension set up as executable, you can abbreviate: C:\com\mindprod\amper\amper.jar . Amper does not change any character other than &. It does NOT convert high ascii codes to their Unicode equivalents. Doing that is tricky since it depends on knowing for certain the encoding of the file. If you need to do that now, you can with a Funduc search and replace script. Version History 1.2 fixes a bug in handling entities of the form ￿ 1.3 tidies the code. 1.4 adds an icon and PAD descriptor file. 1.5 2007-06-30 adds support for the -q switch plus internal refactoring.