#!/usr/local/bin/perl -w
#
# Convert ISO Latin 2 from 8-bit to SGML entities
# et 22/4/96
# V.0
#
while (<>) {


# Estonian section: ISO-10: Latin 6
# all other Estonian chars have the same code as in Latin-2, except for o~
# which does not appear in Latin-2
# Two options are provided:

# If you want Estonian to be coded in Latin 6, uncomment the following
#     s/&otilde\;/\xF5/go;
#     s/&Otilde\;/\xD5/go;

# If you want Estonian to be coded in Latin 2, you will see o~ as o''
# uncomment the following:
#    s/&otilde\;/&odblac\;/go;
#    s/&Otilde\;/&Odblac\;/go;


    s/&unused\;/\xA0/go;
    s/&breve\;/\xA2/go;
    s/&uml\;/\xA8/go;
    s/&deg;/\xB0/go;
#    s/&ring\;/\xB0/go;
    s/&ogon\;/\xB2/go;
    s/&acute\;/\xB4/go;
    s/&caron\;/\xB7/go;
    s/&cedil\;/\xB8/go;
    s/&dblac\;/\xBD/go;
    s/&dot\;/\xFF/go;
    s/&times\;/\xD7/go;
    s/&divide\;/\xF7/go;
    s/&circro\;/\xA4/go;   #??? circle with bars - telephone? microphone?
    s/&dash\;/\xAD/go;     #??? thick short dash / hyphen 
    s/&aacute\;/\xE1/go;
    s/&Aacute\;/\xC1/go;
    s/&aogon\;/\xB1/go;
    s/&Aogon\;/\xA1/go;
    s/&acirc\;/\xE2/go;
    s/&Acirc\;/\xC2/go;
    s/&abreve\;/\xE3/go;
    s/&Abreve\;/\xC3/go;
    s/&auml\;/\xE4/go;
    s/&Auml\;/\xC4/go;
    s/&cacute\;/\xE6/go;
    s/&Cacute\;/\xC6/go;
    s/&ccaron\;/\xE8/go;
    s/&Ccaron\;/\xC8/go;
    s/&ccedil\;/\xE7/go;
    s/&Ccedil\;/\xC7/go;
    s/&dcaron\;/\xEF/go;   #Equivalent to small Dcaron, but looks like d'
    s/&dmidot\;/\xEF/go;   #so it dould be 'middle dot', same as as lmidot
    s/&Dcaron\;/\xCF/go;
    s/&dstrok\;/\xF0/go;
    s/&Dstrok\;/\xD0/go;
    s/&eacute\;/\xE9/go;
    s/&Eacute\;/\xC9/go;
    s/&ecaron\;/\xEC/go;
    s/&Ecaron\;/\xCC/go;
    s/&eogon\;/\xEA/go;
    s/&Eogon\;/\xCA/go;
    s/&euml\;/\xEB/go;
    s/&Euml\;/\xCB/go;
    s/&iacute\;/\xED/go;
    s/&Iacute\;/\xCD/go;
    s/&icirc\;/\xEE/go;
    s/&Icirc\;/\xCE/go;
    s/&lacute\;/\xE5/go;
    s/&Lacute\;/\xC5/go;
    s/&lmidot\;/\xB5/go;
    s/&Lmidot\;/\xA5/go;
    s/&lstrok\;/\xB3/go;
    s/&Lstrok\;/\xA3/go;
    s/&nacute\;/\xF1/go;
    s/&Nacute\;/\xD1/go;
    s/&ncaron\;/\xF2/go;
    s/&Ncaron\;/\xD2/go;
    s/&oacute\;/\xF3/go;
    s/&Oacute\;/\xD3/go;
    s/&ocirc\;/\xF4/go;
    s/&Ocirc\;/\xD4/go;
    s/&odblac\;/\xF5/go;
    s/&Odblac\;/\xD5/go;
    s/&ouml\;/\xF6/go;
    s/&Ouml\;/\xD6/go;
    s/&racute\;/\xE0/go;
    s/&Racute\;/\xC0/go;
    s/&rcaron\;/\xF8/go;
    s/&Rcaron\;/\xD8/go;
    s/&sacute\;/\xB6/go;
    s/&Sacute\;/\xA6/go;
    s/&scaron\;/\xB9/go;
    s/&Scaron\;/\xA9/go;
    s/&scedil\;/\xBA/go;
    s/&Scedil\;/\xAA/go;
    s/&szlig\;/\xDF/go;
    s/&tcaron\;/\xBB/go;   #Equivalent to small Tcaron, but looks like t'
    s/&tmidot\;/\xBB/go;   #so it dould be 'middle dot', same as as lmidot
    s/&Tcaron\;/\xAB/go;
    s/&tcedil\;/\xFE/go;
    s/&Tcedil\;/\xDE/go;
    s/&uring\;/\xF9/go;
    s/&Uring\;/\xD9/go;
    s/&uacute\;/\xFA/go;
    s/&Uacute\;/\xDA/go;
    s/&udblac\;/\xFB/go;
    s/&Udblac\;/\xDB/go;
    s/&uuml\;/\xFC/go;
    s/&Uuml\;/\xDC/go;
    s/&yacute\;/\xFD/go;
    s/&Yacute\;/\xDD/go;
    s/&zacute\;/\xBC/go;
    s/&Zacute\;/\xAC/go;
    s/&zcaron\;/\xBE/go;
    s/&Zcaron\;/\xAE/go;
    s/&zdot\;/\xBF/go;
    s/&Zdot\;/\xAF/go;
    print;
}
