#!/usr/bin/perl -i.bak -w
# vim: set sw=4 ts=4 si et:
# Convert language specific Latin 1 characters to the appropriate
# html characters.
#
use vars qw($opt_h);
use Getopt::Std;
#
&getopts("h")||die "ERROR: No such option. -h for help\n";
&help if ($opt_h);
#
while(<>){
	s/¡/\&iexcl;/g;
	s/¿/\&iquest;/g;
	s/À/\&Agrave;/g;
	s/Á/\&Aacute;/g;
	s/Â/\&Acirc;/g;
	s/Ã/\&Atilde;/g;
	s/Ä/\&Auml;/g;
	s/Å/\&Aring;/g;
	s/Ç/\&Ccedil;/g;
	s/È/\&Egrave;/g;
	s/É/\&Eacute;/g;
	s/Ê/\&Ecirc;/g;
	s/Ë/\&Euml;/g;
	s/Ì/\&Igrave;/g;
	s/Í/\&Iacute;/g;
	s/Î/\&Icirc;/g;
	s/Ï/\&Iuml;/g;
	s/Ñ/\&Ntilde;/g;
	s/Ò/\&Ograve;/g;
	s/Ó/\&Oacute;/g;
	s/Ô/\&Ocirc;/g;
	s/Õ/\&Otilde;/g;
	s/Ö/\&Ouml;/g;
	s/Ø/\&Oslash;/g;
	s/Ù/\&Ugrave;/g;
	s/Ú/\&Uacute;/g;
	s/Û/\&Ucirc;/g;
	s/Ü/\&Uuml;/g;
	s/Ý/\&Yacute;/g;
	s/ß/\&szlig;/g;
	s/à/\&agrave;/g;
	s/á/\&aacute;/g;
	s/â/\&acirc;/g;
	s/ã/\&atilde;/g;
	s/ä/\&auml;/g;
	s/å/\&aring;/g;
	s/æ/\&aelig;/g;
	s/ç/\&ccedil;/g;
	s/è/\&egrave;/g;
	s/é/\&eacute;/g;
	s/ê/\&ecirc;/g;
	s/ë/\&euml;/g;
	s/ì/\&igrave;/g;
	s/í/\&iacute;/g;
	s/î/\&icirc;/g;
	s/ñ/\&ntilde;/g;
	s/ò/\&ograve;/g;
	s/ó/\&oacute;/g;
	s/ô/\&ocirc;/g;
	s/ö/\&ouml;/g;
	s/ù/\&ugrave;/g;
	s/ú/\&uacute;/g;
	s/û/\&ucirc;/g;
	s/ü/\&uuml;/g;
	print;
}
sub help{
print "htmlconv -- Convert the Umlaute in html pages
USAGE: htmlconv [-h] html-files 

Convert language specific Latin 1 characters to the appropriate
html characters.
This program does in place editing. The original file will be
renamed to filename.bak \n";
exit;
}
__END__ 

