*
*     This program will (hopefully) take input from the standard input, interpret
*     various symbols as foreign language characters, and put the results on the
*     standard output.
*
*     I think I will also insert an @courier{ into it, too.  In case someone's
*     Default font is one of those that doesn't display meta characters.
*
      logical starting
      integer*2 len,i,j
      parameter (len=300)
      character*(len) line,outline
      character*2 inchar
      character*1 outchar
      data starting/.true./
      write (0,'(''Type your message now.  '',
     #           ''End with ^D or a dot on a line by itself.'')')
*
 20   read (5,'(A300)',end=100) line
      if (line .eq. '.') goto 100
      if (starting) write (6,'(''@courier{'',$)')
      starting = .false.
      j = 1
      i = 1
 10      if (line(i:300) .eq. ' ') goto 30
         if (line(i:i) .ne. '@') then
            outline(j:j) = line(i:i)
         else
            inchar = line(i+1:i+2)
            call getcode(inchar,outchar)
            outline(j:j) = outchar
            if (outchar .ne. '@') I = I + 2
         endif
         i = i + 1
         j = j + 1
         goto 10
 30   write (6,'(A)') outline(1:j-1)
      goto 20
*
 100  continue
      end

      subroutine getcode(inchar,outchar)
      character*2 inchar
      character*1 outchar
      integer*2 codenum,i
      parameter (codenum = 134)
      character*2 codes(codenum)
      character*1 decode(codenum)
      data codes/'A`', '`A', 'A''', '''A', 'A^', '^A',
     #     'A~', '~A', 'A"', '"A', 'Ao', 'oA', 'AE', 'C,', ',C', 'E`',
     #     '`E', 'E''', '''E', 'E^', '^E', 'E"', '"E', 'I`', '`I',
     #     'I''', '''I', 'I^', '^I', 'I"', '"I', 'N~', '~N', 'O`',
     #     '`O', 'O''', '''O', 'O^', '^O', 'O~', '~O', 'O"', '"O',
     #     'xx', 'O/', '/O', 'U`', '`U', 'U''', '''U', 'U^', '^U',
     #     'U"', '"U', 'SS', 'ss', 'a`', '`a', 'a''', '''a', 'a^', '^a',
     #     'a~', '~a', 'a"', '"a', 'ao', 'oa', 'ae', 'c,', ',c', 'e`',
     #     '`e', 'e''', '''e', 'e^', '^e', 'e"', '"e', 'i`', '`i',
     #     'i''', '''i', 'i^', '^i', 'i"', '"i', 'n~', '~n', 'o`',
     #     '`o', 'o''', '''o', 'o^', '^o', 'o~', '~o', 'o"', '"o',
     #     ':-', '-:', 'o/', '/o', 'u`', '`u', 'u''', '''u', 'u^', '^u',
     #     'u"', '"u', '12', '14', '34', '1^', '^1', '2^', '^2',
     #     '3^', '^3', '0^', '^0', '<<', '>>', '!!', '??', 'Y''',
     #     '''Y', 'y''', '''y', 'y"', '"y', '+-', '-+'/
      data decode/'À','À','Á','Á','Â',
     #     'Â','Ã','Ã','Ä','Ä','Å','Å','Æ',
     #     'Ç','Ç','È','È','É','É','Ê','Ê',
     #     'Ë','Ë','Ì','Ì','Í','Í','Î','Î',
     #     'Ï','Ï','Ñ','Ñ','Ò','Ò','Ó','Ó',
     #     'Ô','Ô','Õ','Õ','Ö','Ö','×','Ø',
     #     'Ø','Ù','Ù','Ú','Ú','Û','Û','Ü',
     #     'Ü','ß','ß','à','à','á','á',
     #     'â','â','ã','ã','ä','ä','å','å',
     #     'æ','ç','ç','è','è','é','é','ê',
     #     'ê','ë','ë','ì','ì','í','í','î',
     #     'î','ï','ï','ñ','ñ','ò','ò','ó',
     #     'ó','ô','ô','õ','õ','ö','ö','÷',
     #     '÷','ø','ø','ù','ù','ú','ú','û',
     #     'û','ü','ü','½','¼','¾','¹','¹',
     #     '²','²','³','³','°','°','«','»',
     #     '¡','¿','Ý','Ý','ý','ý','ÿ','ÿ',
     #     '±','±'/

      do 100 i = 1,codenum
         if (inchar .eq. codes(i)) then
            outchar = decode(i)
            return
         endif
 100  continue
      outchar = '@'
      end
