#!/usr/bin/perl
# web2elot.pl -- Version 0.02a 98.02.02 18:34
# (c) 1997,1998 Hellenic Resources Institute, Inc.

while(<>) {
  # Get rid of ^M's and trailing spaces...

  s/\015$//g;
  s/\s*$//g;

  # No need for these to be HTML-compliant

  s/&quot;/\"/g;
  s/&amp;/&/g;
  s/&nbsp;/ /g;

  # ISO-8859-1 8bit codes

  s/&Agrave;/\300/g;
  s/&Aacute;/\301/g;
  s/&Acirc;/\302/g;
  s/&Atilde;/\303/g;
  s/&Auml;/\304/g;
  s/&Aring;/\305/g;
  s/&AElig;/\306/g;
  s/&Ccedil;/\307/g;
  s/&Egrave;/\310/g;
  s/&Eacute;/\311/g;
  s/&Ecirc;/\312/g;
  s/&Euml;/\313/g;
  s/&Igrave;/\314/g;
  s/&Iacute;/\315/g;
  s/&Icirc;/\316/g;
  s/&Iuml;/\317/g;
  s/&ETH;/\320/g;
  s/&Ntilde;/\321/g;
  s/&Ograve;/\322/g;
  s/&Oacute;/\323/g;
  s/&Ocirc;/\324/g;
  s/&Otilde;/\325/g;
  s/&Ouml;/\326/g;
  s/&Oslash;/\330/g;
  s/&Ugrave;/\331/g;
  s/&Uacute;/\332/g;
  s/&Ucirc;/\333/g;
  s/&Uuml;/\334/g;
  s/&Yacute;/\335/g;
  s/&THORN;/\336/g;
  s/&szlig;/\337/g;
  s/&agrave;/\340/g;
  s/&aacute;/\341/g;
  s/&acirc;/\342/g;
  s/&atilde;/\343/g;
  s/&auml;/\344/g;
  s/&aring;/\345/g;
  s/&aelig;/\346/g;
  s/&ccedil;/\347/g;
  s/&egrave;/\350/g;
  s/&eacute;/\351/g;
  s/&ecirc;/\352/g;
  s/&euml;/\353/g;
  s/&igrave;/\354/g;
  s/&iacute;/\355/g;
  s/&icirc;/\356/g;
  s/&iuml;/\357/g;
  s/&eth;/\360/g;
  s/&ntilde;/\361/g;
  s/&ograve;/\362/g;
  s/&oacute;/\363/g;
  s/&ocirc;/\364/g;
  s/&otilde;/\365/g;
  s/&ouml;/\366/g;
  s/&oslash;/\370/g;
  s/&ugrave;/\371/g;
  s/&uacute;/\372/g;
  s/&ucirc;/\373/g;
  s/&uuml;/\374/g;
  s/&yacute;/\375/g;
  s/&thorn;/\376/g;
  s/&yuml;/\377/g;

  # Greek Chars without ISO-8859-1 equivalents
  
  s/&#215;/\327/g;
  s/&#247;/\367/g;
  s/&#162;/\266/g;

  # Unicode

  s/&#913;/Á/g;
  s/&#914;/Â/g;
  s/&#915;/Ø/g;
  s/&#916;/Ä/g;
  s/&#917;/Å/g;
  s/&#918;/Æ/g;
  s/&#919;/Ç/g;
  s/&#920;/È/g;
  s/&#921;/É/g;
  s/&#922;/Ê/g;
  s/&#923;/Ë/g;
  s/&#924;/Ì/g;
  s/&#925;/Í/g;
  s/&#926;/Î/g;
  s/&#927;/Ï/g;
  s/&#928;/Ð/g;
  s/&#929;/Ñ/g;
  s/&#931;/Ó/g;
  s/&#931;/Ó/g;
  s/&#932;/Ô/g;
  s/&#933;/Õ/g;
  s/&#934;/Ö/g;
  s/&#935;/×/g;
  s/&#936;/Õ/g;
  s/&#937;/Ù/g;
  s/&#902;/¢/g;
  s/&#904;/¸/g;
  s/&#905;/¹/g;
  s/&#906;/º/g;
  s/&#908;/¼/g;
  s/&#910;/¾/g;
  s/&#911;/¿/g;
  s/&#938;/Ú/g;
  s/&#939;/Û/g;
  s/&#945;/á/g;
  s/&#946;/â/g;
  s/&#947;/ã/g;
  s/&#948;/ä/g;
  s/&#949;/å/g;
  s/&#950;/æ/g;
  s/&#951;/ç/g;
  s/&#952;/è/g;
  s/&#953;/é/g;
  s/&#954;/ê/g;
  s/&#955;/ë/g;
  s/&#956;/ì/g;
  s/&#957;/í/g;
  s/&#958;/î/g;
  s/&#959;/ï/g;
  s/&#960;/ð/g;
  s/&#961;/ñ/g;
  s/&#962;/ò/g;
  s/&#963;/ó/g;
  s/&#964;/ô/g;
  s/&#965;/õ/g;
  s/&#966;/ö/g;
  s/&#967;/÷/g;
  s/&#968;/ø/g;
  s/&#969;/ù/g;
  s/&#940;/Ü/g;
  s/&#941;/Ý/g;
  s/&#942;/Þ/g;
  s/&#943;/ß/g;
  s/&#972;/ü/g;
  s/&#973;/ý/g;
  s/&#974;/þ/g;
  s/&#970;/ú/g;
  s/&#971;/û/g;

  print;
}
