Back to index

tetex-bin  3.0
lang.c
Go to the documentation of this file.
00001 /* lang.c -- language-dependent support.
00002    $Id: lang.c,v 1.14 2004/11/22 23:57:33 karl Exp $
00003 
00004    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software
00005    Foundation, Inc.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2, or (at your option)
00010    any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 
00021    Originally written by Karl Heinz Marbaise <kama@hippo.fido.de>.  */
00022 
00023 #include "system.h"
00024 #include "cmds.h"
00025 #include "files.h"
00026 #include "lang.h"
00027 #include "makeinfo.h"
00028 #include "xml.h"
00029 
00030 /* Current document encoding.  */
00031 encoding_code_type document_encoding_code = no_encoding;
00032 
00033 /* Current language code; default is English.  */
00034 language_code_type language_code = en;
00035 
00036 /* By default, unsupported encoding is an empty string.  */
00037 char *unknown_encoding = NULL;
00038 
00039 static iso_map_type us_ascii_map [] = {{NULL, 0, 0}}; /* ASCII map is trivial */
00040 
00041 /* Translation table between HTML and ISO Codes.  The last item is
00042    hopefully the Unicode. It might be possible that those Unicodes are
00043    not correct, cause I didn't check them. kama */
00044 static iso_map_type iso8859_1_map [] = {
00045   { "nbsp",   0xA0, 0x00A0 },
00046   { "iexcl",  0xA1, 0x00A1 },
00047   { "cent",   0xA2, 0x00A2 },
00048   { "pound",  0xA3, 0x00A3 },
00049   { "curren", 0xA4, 0x00A4 },
00050   { "yen",    0xA5, 0x00A5 },
00051   { "brkbar", 0xA6, 0x00A6 },
00052   { "sect",   0xA7, 0x00A7 },
00053   { "uml",    0xA8, 0x00A8 },
00054   { "copy",   0xA9, 0x00A9 },
00055   { "ordf",   0xAA, 0x00AA },
00056   { "laquo",  0xAB, 0x00AB },
00057   { "not",    0xAC, 0x00AC },
00058   { "shy",    0xAD, 0x00AD },
00059   { "reg",    0xAE, 0x00AE },
00060   { "hibar",  0xAF, 0x00AF },
00061   { "deg",    0xB0, 0x00B0 },
00062   { "plusmn", 0xB1, 0x00B1 },
00063   { "sup2",   0xB2, 0x00B2 },
00064   { "sup3",   0xB3, 0x00B3 },
00065   { "acute",  0xB4, 0x00B4 },
00066   { "micro",  0xB5, 0x00B5 },
00067   { "para",   0xB6, 0x00B6 },
00068   { "middot", 0xB7, 0x00B7 },
00069   { "cedil",  0xB8, 0x00B8 },
00070   { "sup1",   0xB9, 0x00B9 },
00071   { "ordm",   0xBA, 0x00BA },
00072   { "raquo",  0xBB, 0x00BB },
00073   { "frac14", 0xBC, 0x00BC },
00074   { "frac12", 0xBD, 0x00BD },
00075   { "frac34", 0xBE, 0x00BE },
00076   { "iquest", 0xBF, 0x00BF },
00077   { "Agrave", 0xC0, 0x00C0 },
00078   { "Aacute", 0xC1, 0x00C1 },
00079   { "Acirc",  0xC2, 0x00C2 },
00080   { "Atilde", 0xC3, 0x00C3 },
00081   { "Auml",   0xC4, 0x00C4 },
00082   { "Aring",  0xC5, 0x00C5 },
00083   { "AElig",  0xC6, 0x00C6 },
00084   { "Ccedil", 0xC7, 0x00C7 },
00085   { "Ccedil", 0xC7, 0x00C7 },
00086   { "Egrave", 0xC8, 0x00C8 },
00087   { "Eacute", 0xC9, 0x00C9 },
00088   { "Ecirc",  0xCA, 0x00CA },
00089   { "Euml",   0xCB, 0x00CB },
00090   { "Igrave", 0xCC, 0x00CC },
00091   { "Iacute", 0xCD, 0x00CD },
00092   { "Icirc",  0xCE, 0x00CE },
00093   { "Iuml",   0xCF, 0x00CF },
00094   { "ETH",    0xD0, 0x00D0 },
00095   { "Ntilde", 0xD1, 0x00D1 },
00096   { "Ograve", 0xD2, 0x00D2 },
00097   { "Oacute", 0xD3, 0x00D3 },
00098   { "Ocirc",  0xD4, 0x00D4 },
00099   { "Otilde", 0xD5, 0x00D5 },
00100   { "Ouml",   0xD6, 0x00D6 },
00101   { "times",  0xD7, 0x00D7 },
00102   { "Oslash", 0xD8, 0x00D8 },
00103   { "Ugrave", 0xD9, 0x00D9 },
00104   { "Uacute", 0xDA, 0x00DA },
00105   { "Ucirc",  0xDB, 0x00DB },
00106   { "Uuml",   0xDC, 0x00DC },
00107   { "Yacute", 0xDD, 0x00DD },
00108   { "THORN",  0xDE, 0x00DE },
00109   { "szlig",  0xDF, 0x00DF },
00110   { "agrave", 0xE0, 0x00E0 },
00111   { "aacute", 0xE1, 0x00E1 },
00112   { "acirc",  0xE2, 0x00E2 },
00113   { "atilde", 0xE3, 0x00E3 },
00114   { "auml",   0xE4, 0x00E4 },
00115   { "aring",  0xE5, 0x00E5 },
00116   { "aelig",  0xE6, 0x00E6 },
00117   { "ccedil", 0xE7, 0x00E7 },
00118   { "egrave", 0xE8, 0x00E8 },
00119   { "eacute", 0xE9, 0x00E9 },
00120   { "ecirc",  0xEA, 0x00EA },
00121   { "euml",   0xEB, 0x00EB },
00122   { "igrave", 0xEC, 0x00EC },
00123   { "iacute", 0xED, 0x00ED },
00124   { "icirc",  0xEE, 0x00EE },
00125   { "iuml",   0xEF, 0x00EF },
00126   { "eth",    0xF0, 0x00F0 },
00127   { "ntilde", 0xF1, 0x00F1 },
00128   { "ograve", 0xF2, 0x00F2 },
00129   { "oacute", 0xF3, 0x00F3 },
00130   { "ocirc",  0xF4, 0x00F4 },
00131   { "otilde", 0xF5, 0x00F5 },
00132   { "ouml",   0xF6, 0x00F6 },
00133   { "divide", 0xF7, 0x00F7 },
00134   { "oslash", 0xF8, 0x00F8 },
00135   { "ugrave", 0xF9, 0x00F9 },
00136   { "uacute", 0xFA, 0x00FA },
00137   { "ucirc",  0xFB, 0x00FB },
00138   { "uuml",   0xFC, 0x00FC },
00139   { "yacute", 0xFD, 0x00FD },
00140   { "thorn",  0xFE, 0x00FE },
00141   { "yuml",   0xFF, 0x00FF },
00142   { NULL, 0, 0 }
00143 };
00144 
00145 
00146 /* ISO 8859-15, also known as Latin 9, differs from Latin 1 in only a
00147    few positions.  http://www.cs.tut.fi/~jkorpela/latin9.html has a good
00148    explanation and listing, summarized here.  The names are abbreviated
00149    from the official Unicode names, to fit in a decent line length.
00150 
00151   code position
00152   dec  oct   hex   latin1 latin1 name           latin9 latin9 name
00153 
00154   164  0244  0xA4   U+00A4 currency symbol    U+20AC euro sign
00155   166  0246  0xA6   U+00A6 broken bar           U+0160 S with caron
00156   168  0250  0xA8   U+00A8 diaeresis            U+0161 s with caron
00157   180  0264  0xB4   U+00B4 acute accent         U+017D Z with caron
00158   184  0270  0xB8   U+00B8 cedilla       U+017E z with caron
00159   188  0274  0xBC   U+00BC fraction 1/4         U+0152 ligature OE
00160   189  0275  0xBD   U+00BD fraction 1/2         U+0153 ligature oe
00161   190  0276  0xBE   U+00BE fraction 3/4         U+0178 Y with diaeresis
00162 */
00163 
00164 static iso_map_type iso8859_15_map [] = {
00165   { "nbsp",   0xA0, 0x00A0 },
00166   { "iexcl",  0xA1, 0x00A1 },
00167   { "cent",   0xA2, 0x00A2 },
00168   { "pound",  0xA3, 0x00A3 },
00169   { "euro",   0xA4, 0x20AC },
00170   { "yen",    0xA5, 0x00A5 },
00171   { "Scaron", 0xA6, 0x0160 },
00172   { "sect",   0xA7, 0x00A7 },
00173   { "scaron", 0xA8, 0x0161 },
00174   { "copy",   0xA9, 0x00A9 },
00175   { "ordf",   0xAA, 0x00AA },
00176   { "laquo",  0xAB, 0x00AB },
00177   { "not",    0xAC, 0x00AC },
00178   { "shy",    0xAD, 0x00AD },
00179   { "reg",    0xAE, 0x00AE },
00180   { "hibar",  0xAF, 0x00AF },
00181   { "deg",    0xB0, 0x00B0 },
00182   { "plusmn", 0xB1, 0x00B1 },
00183   { "sup2",   0xB2, 0x00B2 },
00184   { "sup3",   0xB3, 0x00B3 },
00185   { "Zcaron", 0xB4, 0x017D },
00186   { "micro",  0xB5, 0x00B5 },
00187   { "para",   0xB6, 0x00B6 },
00188   { "middot", 0xB7, 0x00B7 },
00189   { "zcaron", 0xB8, 0x017E },
00190   { "sup1",   0xB9, 0x00B9 },
00191   { "ordm",   0xBA, 0x00BA },
00192   { "raquo",  0xBB, 0x00BB },
00193   { "OElig",  0xBC, 0x0152 },
00194   { "oelig",  0xBD, 0x0153 },
00195   { "Yuml",   0xBE, 0x0178 },
00196   { "iquest", 0xBF, 0x00BF },
00197   { "Agrave", 0xC0, 0x00C0 },
00198   { "Aacute", 0xC1, 0x00C1 },
00199   { "Acirc",  0xC2, 0x00C2 },
00200   { "Atilde", 0xC3, 0x00C3 },
00201   { "Auml",   0xC4, 0x00C4 },
00202   { "Aring",  0xC5, 0x00C5 },
00203   { "AElig",  0xC6, 0x00C6 },
00204   { "Ccedil", 0xC7, 0x00C7 },
00205   { "Ccedil", 0xC7, 0x00C7 },
00206   { "Egrave", 0xC8, 0x00C8 },
00207   { "Eacute", 0xC9, 0x00C9 },
00208   { "Ecirc",  0xCA, 0x00CA },
00209   { "Euml",   0xCB, 0x00CB },
00210   { "Igrave", 0xCC, 0x00CC },
00211   { "Iacute", 0xCD, 0x00CD },
00212   { "Icirc",  0xCE, 0x00CE },
00213   { "Iuml",   0xCF, 0x00CF },
00214   { "ETH",    0xD0, 0x00D0 },
00215   { "Ntilde", 0xD1, 0x00D1 },
00216   { "Ograve", 0xD2, 0x00D2 },
00217   { "Oacute", 0xD3, 0x00D3 },
00218   { "Ocirc",  0xD4, 0x00D4 },
00219   { "Otilde", 0xD5, 0x00D5 },
00220   { "Ouml",   0xD6, 0x00D6 },
00221   { "times",  0xD7, 0x00D7 },
00222   { "Oslash", 0xD8, 0x00D8 },
00223   { "Ugrave", 0xD9, 0x00D9 },
00224   { "Uacute", 0xDA, 0x00DA },
00225   { "Ucirc",  0xDB, 0x00DB },
00226   { "Uuml",   0xDC, 0x00DC },
00227   { "Yacute", 0xDD, 0x00DD },
00228   { "THORN",  0xDE, 0x00DE },
00229   { "szlig",  0xDF, 0x00DF },
00230   { "agrave", 0xE0, 0x00E0 },
00231   { "aacute", 0xE1, 0x00E1 },
00232   { "acirc",  0xE2, 0x00E2 },
00233   { "atilde", 0xE3, 0x00E3 },
00234   { "auml",   0xE4, 0x00E4 },
00235   { "aring",  0xE5, 0x00E5 },
00236   { "aelig",  0xE6, 0x00E6 },
00237   { "ccedil", 0xE7, 0x00E7 },
00238   { "egrave", 0xE8, 0x00E8 },
00239   { "eacute", 0xE9, 0x00E9 },
00240   { "ecirc",  0xEA, 0x00EA },
00241   { "euml",   0xEB, 0x00EB },
00242   { "igrave", 0xEC, 0x00EC },
00243   { "iacute", 0xED, 0x00ED },
00244   { "icirc",  0xEE, 0x00EE },
00245   { "iuml",   0xEF, 0x00EF },
00246   { "eth",    0xF0, 0x00F0 },
00247   { "ntilde", 0xF1, 0x00F1 },
00248   { "ograve", 0xF2, 0x00F2 },
00249   { "oacute", 0xF3, 0x00F3 },
00250   { "ocirc",  0xF4, 0x00F4 },
00251   { "otilde", 0xF5, 0x00F5 },
00252   { "ouml",   0xF6, 0x00F6 },
00253   { "divide", 0xF7, 0x00F7 },
00254   { "oslash", 0xF8, 0x00F8 },
00255   { "ugrave", 0xF9, 0x00F9 },
00256   { "uacute", 0xFA, 0x00FA },
00257   { "ucirc",  0xFB, 0x00FB },
00258   { "uuml",   0xFC, 0x00FC },
00259   { "yacute", 0xFD, 0x00FD },
00260   { "thorn",  0xFE, 0x00FE },
00261   { "yuml",   0xFF, 0x00FF },
00262   { NULL, 0, 0 }
00263 };
00264 
00265 
00266 
00267 /* Date: Mon, 31 Mar 2003 00:19:28 +0200
00268    From: Wojciech Polak <polak@gnu.org>
00269 ...
00270  * Primary Polish site for ogonki is http://www.agh.edu.pl/ogonki/,
00271    but it's only in Polish language (it has some interesting links).
00272 
00273  * A general site about ISO 8859-2 at http://nl.ijs.si/gnusl/cee/iso8859-2.html
00274 
00275  * ISO 8859-2 Character Set at http://nl.ijs.si/gnusl/cee/charset.html
00276    This site provides almost all information about iso-8859-2,
00277    including the character table!!! (must see!)
00278 
00279  * ISO 8859-2 and even HTML entities !!! (must see!)
00280    http://people.ssh.fi/mtr/genscript/88592.txt
00281 
00282  * (minor) http://www.agh.edu.pl/ogonki/plchars.html
00283    One more table, this time it includes even information about Polish
00284    characters in Unicode.
00285 */
00286 
00287 static iso_map_type iso8859_2_map [] = {
00288   { "nbsp",   0xA0, 0x00A0 }, /* NO-BREAK SPACE */
00289   { "",       0xA1, 0x0104 }, /* LATIN CAPITAL LETTER A WITH OGONEK */
00290   { "",       0xA2, 0x02D8 }, /* BREVE */
00291   { "",       0xA3, 0x0141 }, /* LATIN CAPITAL LETTER L WITH STROKE */
00292   { "curren", 0xA4, 0x00A4 }, /* CURRENCY SIGN */
00293   { "",       0xA5, 0x013D }, /* LATIN CAPITAL LETTER L WITH CARON */
00294   { "",       0xA6, 0x015A }, /* LATIN CAPITAL LETTER S WITH ACUTE */
00295   { "sect",   0xA7, 0x00A7 }, /* SECTION SIGN */
00296   { "uml",    0xA8, 0x00A8 }, /* DIAERESIS */
00297   { "",       0xA9, 0x0160 }, /* LATIN CAPITAL LETTER S WITH CARON */
00298   { "",       0xAA, 0x015E }, /* LATIN CAPITAL LETTER S WITH CEDILLA */
00299   { "",       0xAB, 0x0164 }, /* LATIN CAPITAL LETTER T WITH CARON */
00300   { "",       0xAC, 0x0179 }, /* LATIN CAPITAL LETTER Z WITH ACUTE */
00301   { "shy",    0xAD, 0x00AD }, /* SOFT HYPHEN */
00302   { "",       0xAE, 0x017D }, /* LATIN CAPITAL LETTER Z WITH CARON */
00303   { "",       0xAF, 0x017B }, /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */
00304   { "deg",    0xB0, 0x00B0 }, /* DEGREE SIGN */
00305   { "",       0xB1, 0x0105 }, /* LATIN SMALL LETTER A WITH OGONEK */
00306   { "",       0xB2, 0x02DB }, /* OGONEK */
00307   { "",       0xB3, 0x0142 }, /* LATIN SMALL LETTER L WITH STROKE */
00308   { "acute",  0xB4, 0x00B4 }, /* ACUTE ACCENT */
00309   { "",       0xB5, 0x013E }, /* LATIN SMALL LETTER L WITH CARON */
00310   { "",       0xB6, 0x015B }, /* LATIN SMALL LETTER S WITH ACUTE */
00311   { "",       0xB7, 0x02C7 }, /* CARON (Mandarin Chinese third tone) */
00312   { "cedil",  0xB8, 0x00B8 }, /* CEDILLA */
00313   { "",       0xB9, 0x0161 }, /* LATIN SMALL LETTER S WITH CARON */
00314   { "",       0xBA, 0x015F }, /* LATIN SMALL LETTER S WITH CEDILLA */
00315   { "",       0xBB, 0x0165 }, /* LATIN SMALL LETTER T WITH CARON */
00316   { "",       0xBC, 0x017A }, /* LATIN SMALL LETTER Z WITH ACUTE */
00317   { "",       0xBD, 0x02DD }, /* DOUBLE ACUTE ACCENT */
00318   { "",       0xBE, 0x017E }, /* LATIN SMALL LETTER Z WITH CARON */
00319   { "",       0xBF, 0x017C }, /* LATIN SMALL LETTER Z WITH DOT ABOVE */
00320   { "",       0xC0, 0x0154 }, /* LATIN CAPITAL LETTER R WITH ACUTE */
00321   { "",       0xC1, 0x00C1 }, /* LATIN CAPITAL LETTER A WITH ACUTE */
00322   { "",       0xC2, 0x00C2 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
00323   { "",       0xC3, 0x0102 }, /* LATIN CAPITAL LETTER A WITH BREVE */
00324   { "",       0xC4, 0x00C4 }, /* LATIN CAPITAL LETTER A WITH DIAERESIS */
00325   { "",       0xC5, 0x0139 }, /* LATIN CAPITAL LETTER L WITH ACUTE */
00326   { "",       0xC6, 0x0106 }, /* LATIN CAPITAL LETTER C WITH ACUTE */
00327   { "",       0xC7, 0x00C7 }, /* LATIN CAPITAL LETTER C WITH CEDILLA */
00328   { "",       0xC8, 0x010C }, /* LATIN CAPITAL LETTER C WITH CARON */
00329   { "",       0xC9, 0x00C9 }, /* LATIN CAPITAL LETTER E WITH ACUTE */
00330   { "",       0xCA, 0x0118 }, /* LATIN CAPITAL LETTER E WITH OGONEK */
00331   { "",       0xCB, 0x00CB }, /* LATIN CAPITAL LETTER E WITH DIAERESIS */
00332   { "",       0xCC, 0x011A }, /* LATIN CAPITAL LETTER E WITH CARON */
00333   { "",       0xCD, 0x00CD }, /* LATIN CAPITAL LETTER I WITH ACUTE */
00334   { "",       0xCE, 0x00CE }, /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
00335   { "",       0xCF, 0x010E }, /* LATIN CAPITAL LETTER D WITH CARON */
00336   { "",       0xD0, 0x0110 }, /* LATIN CAPITAL LETTER D WITH STROKE */
00337   { "",       0xD1, 0x0143 }, /* LATIN CAPITAL LETTER N WITH ACUTE */
00338   { "",       0xD2, 0x0147 }, /* LATIN CAPITAL LETTER N WITH CARON */
00339   { "",       0xD3, 0x00D3 }, /* LATIN CAPITAL LETTER O WITH ACUTE */
00340   { "",       0xD4, 0x00D4 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
00341   { "",       0xD5, 0x0150 }, /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
00342   { "",       0xD6, 0x00D6 }, /* LATIN CAPITAL LETTER O WITH DIAERESIS */
00343   { "times",  0xD7, 0x00D7 }, /* MULTIPLICATION SIGN */
00344   { "",       0xD8, 0x0158 }, /* LATIN CAPITAL LETTER R WITH CARON */
00345   { "",       0xD9, 0x016E }, /* LATIN CAPITAL LETTER U WITH RING ABOVE */
00346   { "",       0xDA, 0x00DA }, /* LATIN CAPITAL LETTER U WITH ACUTE */
00347   { "",       0xDB, 0x0170 }, /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
00348   { "",       0xDC, 0x00DC }, /* LATIN CAPITAL LETTER U WITH DIAERESIS */
00349   { "",       0xDD, 0x00DD }, /* LATIN CAPITAL LETTER Y WITH ACUTE */
00350   { "",       0xDE, 0x0162 }, /* LATIN CAPITAL LETTER T WITH CEDILLA */
00351   { "",       0xDF, 0x00DF }, /* LATIN SMALL LETTER SHARP S (German) */
00352   { "",       0xE0, 0x0155 }, /* LATIN SMALL LETTER R WITH ACUTE */
00353   { "",       0xE1, 0x00E1 }, /* LATIN SMALL LETTER A WITH ACUTE */
00354   { "",       0xE2, 0x00E2 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX */
00355   { "",       0xE3, 0x0103 }, /* LATIN SMALL LETTER A WITH BREVE */
00356   { "",       0xE4, 0x00E4 }, /* LATIN SMALL LETTER A WITH DIAERESIS */
00357   { "",       0xE5, 0x013A }, /* LATIN SMALL LETTER L WITH ACUTE */
00358   { "",       0xE6, 0x0107 }, /* LATIN SMALL LETTER C WITH ACUTE */
00359   { "",       0xE7, 0x00E7 }, /* LATIN SMALL LETTER C WITH CEDILLA */
00360   { "",       0xE8, 0x010D }, /* LATIN SMALL LETTER C WITH CARON */
00361   { "",       0xE9, 0x00E9 }, /* LATIN SMALL LETTER E WITH ACUTE */
00362   { "",       0xEA, 0x0119 }, /* LATIN SMALL LETTER E WITH OGONEK */
00363   { "",       0xEB, 0x00EB }, /* LATIN SMALL LETTER E WITH DIAERESIS */
00364   { "",       0xEC, 0x011B }, /* LATIN SMALL LETTER E WITH CARON */
00365   { "",       0xED, 0x00ED }, /* LATIN SMALL LETTER I WITH ACUTE */
00366   { "",       0xEE, 0x00EE }, /* LATIN SMALL LETTER I WITH CIRCUMFLEX */
00367   { "",       0xEF, 0x010F }, /* LATIN SMALL LETTER D WITH CARON */
00368   { "",       0xF0, 0x0111 }, /* LATIN SMALL LETTER D WITH STROKE */
00369   { "",       0xF1, 0x0144 }, /* LATIN SMALL LETTER N WITH ACUTE */
00370   { "",       0xF2, 0x0148 }, /* LATIN SMALL LETTER N WITH CARON */
00371   { "",       0xF3, 0x00F3 }, /* LATIN SMALL LETTER O WITH ACUTE */
00372   { "",       0xF4, 0x00F4 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX */
00373   { "",       0xF5, 0x0151 }, /* LATIN SMALL LETTER O WITH DOUBLE ACUTE */
00374   { "",       0xF6, 0x00F6 }, /* LATIN SMALL LETTER O WITH DIAERESIS */
00375   { "divide", 0xF7, 0x00F7 }, /* DIVISION SIGN */
00376   { "",       0xF8, 0x0159 }, /* LATIN SMALL LETTER R WITH CARON */
00377   { "",       0xF9, 0x016F }, /* LATIN SMALL LETTER U WITH RING ABOVE */
00378   { "",       0xFA, 0x00FA }, /* LATIN SMALL LETTER U WITH ACUTE */
00379   { "",       0xFB, 0x0171 }, /* LATIN SMALL LETTER U WITH DOUBLE ACUTE */
00380   { "",       0xFC, 0x00FC }, /* LATIN SMALL LETTER U WITH DIAERESIS */
00381   { "",       0xFD, 0x00FD }, /* LATIN SMALL LETTER Y WITH ACUTE */
00382   { "",       0xFE, 0x0163 }, /* LATIN SMALL LETTER T WITH CEDILLA */
00383   { "",       0xFF, 0x02D9 }, /* DOT ABOVE (Mandarin Chinese light tone) */
00384   { NULL, 0, 0 }
00385 };
00386 
00387 encoding_type encoding_table[] = {
00388   { no_encoding, "(no encoding)", NULL },
00389   { US_ASCII,    "US-ASCII",    us_ascii_map },
00390   { ISO_8859_1,  "iso-8859-1",  (iso_map_type *) iso8859_1_map },
00391   { ISO_8859_2,  "iso-8859-2",  (iso_map_type *) iso8859_2_map },
00392   { ISO_8859_3,  "iso-8859-3",  NULL },
00393   { ISO_8859_4,  "iso-8859-4",  NULL },
00394   { ISO_8859_5,  "iso-8859-5",  NULL },
00395   { ISO_8859_6,  "iso-8859-6",  NULL },
00396   { ISO_8859_7,  "iso-8859-7",  NULL },
00397   { ISO_8859_8,  "iso-8859-8",  NULL },
00398   { ISO_8859_9,  "iso-8859-9",  NULL },
00399   { ISO_8859_10, "iso-8859-10", NULL },
00400   { ISO_8859_11, "iso-8859-11", NULL },
00401   { ISO_8859_12, "iso-8859-12", NULL },
00402   { ISO_8859_13, "iso-8859-13", NULL },
00403   { ISO_8859_14, "iso-8859-14", NULL },
00404   { ISO_8859_15, "iso-8859-15", (iso_map_type *) iso8859_15_map },
00405   { last_encoding_code, NULL, NULL }
00406 };
00407 
00408 
00409 language_type language_table[] = {
00410   { aa, "aa", "Afar" },
00411   { ab, "ab", "Abkhazian" },
00412   { af, "af", "Afrikaans" },
00413   { am, "am", "Amharic" },
00414   { ar, "ar", "Arabic" },
00415   { as, "as", "Assamese" },
00416   { ay, "ay", "Aymara" },
00417   { az, "az", "Azerbaijani" },
00418   { ba, "ba", "Bashkir" },
00419   { be, "be", "Byelorussian" },
00420   { bg, "bg", "Bulgarian" },
00421   { bh, "bh", "Bihari" },
00422   { bi, "bi", "Bislama" },
00423   { bn, "bn", "Bengali; Bangla" },
00424   { bo, "bo", "Tibetan" },
00425   { br, "br", "Breton" },
00426   { ca, "ca", "Catalan" },
00427   { co, "co", "Corsican" },
00428   { cs, "cs", "Czech" },
00429   { cy, "cy", "Welsh" },
00430   { da, "da", "Danish" },
00431   { de, "de", "German" },
00432   { dz, "dz", "Bhutani" },
00433   { el, "el", "Greek" },
00434   { en, "en", "English" },
00435   { eo, "eo", "Esperanto" },
00436   { es, "es", "Spanish" },
00437   { et, "et", "Estonian" },
00438   { eu, "eu", "Basque" },
00439   { fa, "fa", "Persian" },
00440   { fi, "fi", "Finnish" },
00441   { fj, "fj", "Fiji" },
00442   { fo, "fo", "Faroese" },
00443   { fr, "fr", "French" },
00444   { fy, "fy", "Frisian" },
00445   { ga, "ga", "Irish" },
00446   { gd, "gd", "Scots Gaelic" },
00447   { gl, "gl", "Galician" },
00448   { gn, "gn", "Guarani" },
00449   { gu, "gu", "Gujarati" },
00450   { ha, "ha", "Hausa" },
00451   { he, "he", "Hebrew" } /* (formerly iw) */,
00452   { hi, "hi", "Hindi" },
00453   { hr, "hr", "Croatian" },
00454   { hu, "hu", "Hungarian" },
00455   { hy, "hy", "Armenian" },
00456   { ia, "ia", "Interlingua" },
00457   { id, "id", "Indonesian" } /* (formerly in) */,
00458   { ie, "ie", "Interlingue" },
00459   { ik, "ik", "Inupiak" },
00460   { is, "is", "Icelandic" },
00461   { it, "it", "Italian" },
00462   { iu, "iu", "Inuktitut" },
00463   { ja, "ja", "Japanese" },
00464   { jw, "jw", "Javanese" },
00465   { ka, "ka", "Georgian" },
00466   { kk, "kk", "Kazakh" },
00467   { kl, "kl", "Greenlandic" },
00468   { km, "km", "Cambodian" },
00469   { kn, "kn", "Kannada" },
00470   { ko, "ko", "Korean" },
00471   { ks, "ks", "Kashmiri" },
00472   { ku, "ku", "Kurdish" },
00473   { ky, "ky", "Kirghiz" },
00474   { la, "la", "Latin" },
00475   { ln, "ln", "Lingala" },
00476   { lo, "lo", "Laothian" },
00477   { lt, "lt", "Lithuanian" },
00478   { lv, "lv", "Latvian, Lettish" },
00479   { mg, "mg", "Malagasy" },
00480   { mi, "mi", "Maori" },
00481   { mk, "mk", "Macedonian" },
00482   { ml, "ml", "Malayalam" },
00483   { mn, "mn", "Mongolian" },
00484   { mo, "mo", "Moldavian" },
00485   { mr, "mr", "Marathi" },
00486   { ms, "ms", "Malay" },
00487   { mt, "mt", "Maltese" },
00488   { my, "my", "Burmese" },
00489   { na, "na", "Nauru" },
00490   { ne, "ne", "Nepali" },
00491   { nl, "nl", "Dutch" },
00492   { no, "no", "Norwegian" },
00493   { oc, "oc", "Occitan" },
00494   { om, "om", "(Afan) Oromo" },
00495   { or, "or", "Oriya" },
00496   { pa, "pa", "Punjabi" },
00497   { pl, "pl", "Polish" },
00498   { ps, "ps", "Pashto, Pushto" },
00499   { pt, "pt", "Portuguese" },
00500   { qu, "qu", "Quechua" },
00501   { rm, "rm", "Rhaeto-Romance" },
00502   { rn, "rn", "Kirundi" },
00503   { ro, "ro", "Romanian" },
00504   { ru, "ru", "Russian" },
00505   { rw, "rw", "Kinyarwanda" },
00506   { sa, "sa", "Sanskrit" },
00507   { sd, "sd", "Sindhi" },
00508   { sg, "sg", "Sangro" },
00509   { sh, "sh", "Serbo-Croatian" },
00510   { si, "si", "Sinhalese" },
00511   { sk, "sk", "Slovak" },
00512   { sl, "sl", "Slovenian" },
00513   { sm, "sm", "Samoan" },
00514   { sn, "sn", "Shona" },
00515   { so, "so", "Somali" },
00516   { sq, "sq", "Albanian" },
00517   { sr, "sr", "Serbian" },
00518   { ss, "ss", "Siswati" },
00519   { st, "st", "Sesotho" },
00520   { su, "su", "Sundanese" },
00521   { sv, "sv", "Swedish" },
00522   { sw, "sw", "Swahili" },
00523   { ta, "ta", "Tamil" },
00524   { te, "te", "Telugu" },
00525   { tg, "tg", "Tajik" },
00526   { th, "th", "Thai" },
00527   { ti, "ti", "Tigrinya" },
00528   { tk, "tk", "Turkmen" },
00529   { tl, "tl", "Tagalog" },
00530   { tn, "tn", "Setswana" },
00531   { to, "to", "Tonga" },
00532   { tr, "tr", "Turkish" },
00533   { ts, "ts", "Tsonga" },
00534   { tt, "tt", "Tatar" },
00535   { tw, "tw", "Twi" },
00536   { ug, "ug", "Uighur" },
00537   { uk, "uk", "Ukrainian" },
00538   { ur, "ur", "Urdu" },
00539   { uz, "uz", "Uzbek" },
00540   { vi, "vi", "Vietnamese" },
00541   { vo, "vo", "Volapuk" },
00542   { wo, "wo", "Wolof" },
00543   { xh, "xh", "Xhosa" },
00544   { yi, "yi", "Yiddish" } /* (formerly ji) */,
00545   { yo, "yo", "Yoruba" },
00546   { za, "za", "Zhuang" },
00547   { zh, "zh", "Chinese" },
00548   { zu, "zu", "Zulu" },
00549   { last_language_code, NULL, NULL }
00550 };
00551 
00552 /* @documentlanguage.  Maybe we'll do something useful with this in the
00553    future.  For now, we just recognize it.  */
00554 
00555 /* XML documents can make use of this data.  Unfortunately, it clashes with
00556    the structure currently used.  So instead of enclosing content into
00557    a language block, we just output an empty element.  Anyways, a stream based
00558    parser can make good use of it.  */
00559 void
00560 cm_documentlanguage (void)
00561 {
00562   language_code_type c;
00563   char *lang_arg;
00564 
00565   /* Read the line with the language code on it.  */
00566   get_rest_of_line (0, &lang_arg);
00567 
00568   /* Linear search is fine these days.  */
00569   for (c = aa; c != last_language_code; c++)
00570     {
00571       if (strcmp (lang_arg, language_table[c].abbrev) == 0)
00572         { /* Set current language code.  */
00573           language_code = c;
00574           break;
00575         }
00576     }
00577 
00578   /* If we didn't find this code, complain.  */
00579   if (c == last_language_code)
00580     warning (_("%s is not a valid ISO 639 language code"), lang_arg);
00581 
00582   if (xml && !docbook)
00583     {
00584       xml_insert_element_with_attribute (DOCUMENTLANGUAGE, START, "xml:lang=\"%s\"", lang_arg);
00585       xml_insert_element (DOCUMENTLANGUAGE, END);
00586     }
00587 
00588   free (lang_arg);
00589 }
00590 
00591 
00592 
00593 /* Search through the encoding table for the given character, returning
00594    its equivalent.  */
00595 
00596 static int
00597 cm_search_iso_map (char *html)
00598 {
00599   int i;
00600   iso_map_type *iso = encoding_table[document_encoding_code].isotab;
00601 
00602   /* If no conversion table for this encoding, quit.  */
00603   if (!iso)
00604     return -1;
00605 
00606   for (i = 0; iso[i].html; i++)
00607     {
00608       if (strcmp (html, iso[i].html) == 0)
00609         return i;
00610     }
00611 
00612   return -1;
00613 }
00614 
00615 
00616 /* @documentencoding.  Set the translation table.  */
00617 
00618 void
00619 cm_documentencoding (void)
00620 {
00621   if (!handling_delayed_writes)
00622     {
00623       encoding_code_type enc;
00624       char *enc_arg;
00625 
00626       /* This is ugly and probably needs to apply to other commands'
00627          argument parsing as well.  When we're doing @documentencoding,
00628          we're generally in the frontmatter of the document, and so the.
00629          expansion in html/xml/docbook would generally be the empty string.
00630          (Because those modes wait until the first normal text of the
00631          document to start outputting.)  The result would thus be a warning
00632          "unrecognized encoding name `'".  Sigh.  */
00633       int save_html = html;
00634       int save_xml = xml;
00635 
00636       html = 0;
00637       xml = 0;
00638       get_rest_of_line (1, &enc_arg);
00639       html = save_html;
00640       xml = save_xml;
00641 
00642       /* See if we have this encoding.  */
00643       for (enc = no_encoding+1; enc != last_encoding_code; enc++)
00644         {
00645           if (strcasecmp (enc_arg, encoding_table[enc].encname) == 0)
00646             {
00647               document_encoding_code = enc;
00648               break;
00649             }
00650         }
00651 
00652       /* If we didn't find this code, complain.  */
00653       if (enc == last_encoding_code)
00654         {
00655           warning (_("unrecognized encoding name `%s'"), enc_arg);
00656           /* Let the previous one go.  */
00657           if (unknown_encoding && *unknown_encoding)
00658             free (unknown_encoding);
00659           unknown_encoding = xstrdup (enc_arg);
00660         }
00661 
00662       else if (encoding_table[document_encoding_code].isotab == NULL)
00663         warning (_("sorry, encoding `%s' not supported"), enc_arg);
00664 
00665       free (enc_arg);
00666     }
00667   else if (xml)
00668     {
00669       char *encoding = current_document_encoding ();
00670 
00671       if (encoding && *encoding)
00672         {
00673           insert_string (" encoding=\"");
00674           insert_string (encoding);
00675           insert_string ("\"");
00676         }
00677 
00678       free (encoding);
00679     }
00680 }
00681 
00682 char *
00683 current_document_encoding (void)
00684 {
00685   if (document_encoding_code != no_encoding)
00686     return xstrdup (encoding_table[document_encoding_code].encname);
00687   else if (unknown_encoding && *unknown_encoding)
00688     return xstrdup (unknown_encoding);
00689   else
00690     return xstrdup ("");
00691 }
00692 
00693 
00694 /* If html or xml output, add &HTML_STR; to the output.  If not html and
00695    the user requested encoded output, add the real 8-bit character
00696    corresponding to HTML_STR from the translation tables.  Otherwise,
00697    add INFO_STR.  */
00698 
00699 static void
00700 add_encoded_char (char *html_str, char *info_str)
00701 {
00702   if (html)
00703     add_word_args ("&%s;", html_str);
00704   else if (xml)
00705     xml_insert_entity (html_str);
00706   else if (enable_encoding)
00707     {
00708       /* Look for HTML_STR in the current translation table.  */
00709       int rc = cm_search_iso_map (html_str);
00710       if (rc >= 0)
00711         /* We found it, add the real character.  */
00712         add_char (encoding_table[document_encoding_code].isotab[rc].bytecode);
00713       else
00714         { /* We didn't find it, that seems bad.  */
00715           warning (_("invalid encoded character `%s'"), html_str);
00716           add_word (info_str);
00717         }
00718     }
00719   else
00720     add_word (info_str);
00721 }
00722 
00723 
00724 
00725 /* Output an accent for HTML or XML. */
00726 
00727 static void
00728 cm_accent_generic_html (int arg, int start, int end, char *html_supported,
00729     int single, int html_solo_standalone, char *html_solo)
00730 {
00731   static int valid_html_accent; /* yikes */
00732 
00733   if (arg == START)
00734     { /* If HTML has good support for this character, use it.  */
00735       if (strchr (html_supported, curchar ()))
00736         { /* Yes; start with an ampersand.  The character itself
00737              will be added later in read_command (makeinfo.c).  */
00738          int saved_escape_html = escape_html;
00739          escape_html = 0;
00740           valid_html_accent = 1;
00741           add_char ('&');
00742          escape_html = saved_escape_html;
00743         }
00744       else
00745         { /* @dotless{i} is not listed in html_supported but HTML entities
00746             starting with `i' can be used, such as &icirc;.  */
00747          int save_input_text_offset = input_text_offset;
00748          char *accent_contents;
00749 
00750          get_until_in_braces ("\n", &accent_contents);
00751          canon_white (accent_contents);
00752 
00753          if (strstr (accent_contents, "@dotless{i"))
00754            {
00755              add_word_args ("&%c", accent_contents[9]);
00756              valid_html_accent = 1;
00757            }
00758          else
00759            {
00760              /* Search for @dotless{} wasn't successful, so rewind.  */
00761              input_text_offset = save_input_text_offset;
00762              valid_html_accent = 0;
00763              if (html_solo_standalone)
00764               { /* No special HTML support, so produce standalone char.  */
00765                 if (xml)
00766                   xml_insert_entity (html_solo);
00767                 else
00768                   add_word_args ("&%s;", html_solo);
00769               }
00770              else
00771               /* If the html_solo does not exist as standalone character
00772                  (namely &circ; &grave; &tilde;), then we use
00773                  the single character version instead.  */
00774               add_char (single);
00775            }
00776 
00777          free (accent_contents);
00778         }
00779     }
00780   else if (arg == END)
00781     { /* Only if we saw a valid_html_accent can we use the full
00782          HTML accent (umlaut, grave ...).  */
00783       if (valid_html_accent)
00784         {
00785           add_word (html_solo);
00786           add_char (';');
00787         }
00788     }
00789 }
00790 
00791 
00792 static void
00793 cm_accent_generic_no_headers (int arg, int start, int end, int single,
00794     char *html_solo)
00795 {
00796   if (arg == END)
00797     {
00798       if (no_encoding)
00799         add_char (single);
00800       else
00801         {
00802           int rc;
00803           char *buffer = xmalloc (1 + strlen (html_solo) + 1);
00804           buffer[0] = output_paragraph[end - 1];
00805           buffer[1] = 0;
00806           strcat (buffer, html_solo);
00807 
00808           rc = cm_search_iso_map (buffer);
00809           if (rc >= 0)
00810             /* A little bit tricky ;-)
00811                Here we replace the character which has
00812                been inserted in read_command with
00813                the value we have found in converting table
00814                Does there exist a better way to do this?  kama. */
00815             output_paragraph[end - 1]
00816               = encoding_table[document_encoding_code].isotab[rc].bytecode;
00817           else
00818             { /* If we didn't find a translation for this character,
00819                  put the single instead. E.g., &Xuml; does not exist so X&uml;
00820                  should be produced. */
00821               /* When the below warning is issued, an author has nothing
00822                  wrong in their document, let alone anything ``fixable''
00823                  on their side.  So it is commented out for now.  */
00824               /* warning (_("%s is an invalid ISO code, using %c"),
00825                        buffer, single); */
00826               add_char (single);
00827             }
00828 
00829           free (buffer);
00830         }
00831     }
00832 }
00833 
00834 
00835 
00836 /* Accent commands that take explicit arguments and don't have any
00837    special HTML support.  */
00838 
00839 void
00840 cm_accent (int arg)
00841 {
00842   int old_escape_html = escape_html;
00843   escape_html = 0;
00844   if (arg == START)
00845     {
00846       /* Must come first to avoid ambiguity with overdot.  */
00847       if (strcmp (command, "udotaccent") == 0)      /* underdot */
00848         add_char ('.');
00849     }
00850   else if (arg == END)
00851     {
00852       if (strcmp (command, "=") == 0)               /* macron */
00853         add_word ((html || xml) ? "&macr;" : "=");
00854       else if (strcmp (command, "H") == 0)          /* Hungarian umlaut */
00855         add_word ("''");
00856       else if (strcmp (command, "dotaccent") == 0)  /* overdot */
00857         add_meta_char ('.');
00858       else if (strcmp (command, "ringaccent") == 0) /* ring */
00859         add_char ('*');
00860       else if (strcmp (command, "tieaccent") == 0)  /* long tie */
00861         add_char ('[');
00862       else if (strcmp (command, "u") == 0)          /* breve */
00863         add_char ('(');
00864       else if (strcmp (command, "ubaraccent") == 0) /* underbar */
00865         add_char ('_');
00866       else if (strcmp (command, "v") == 0)          /* hacek/check */
00867         add_word ((html || xml) ? "&lt;" : "<");
00868     }
00869   escape_html = old_escape_html;
00870 }
00871 
00872 /* Common routine for the accent characters that have support in HTML.
00873    If the character being accented is in the HTML_SUPPORTED set, then
00874    produce &CHTML_SOLO;, for example, &Auml; for an A-umlaut.  If not in
00875    HTML_SUPPORTED, just produce &HTML_SOLO;X for the best we can do with
00876    at an X-umlaut.  If not producing HTML, just use SINGLE, a
00877    character such as " which is the best plain text representation we
00878    can manage.  If HTML_SOLO_STANDALONE is nonzero the given HTML_SOLO
00879    exists as valid standalone character in HTML, e.g., &uml;.  */
00880 
00881 static void
00882 cm_accent_generic (int arg, int start, int end, char *html_supported,
00883     int single, int html_solo_standalone, char *html_solo)
00884 {
00885   /* Accentuating space characters makes no sense, so issue a warning.  */
00886   if (arg == START && isspace (input_text[input_text_offset]))
00887     warning ("Accent command `@%s' must not be followed by whitespace",
00888         command);
00889 
00890   if (html || xml)
00891     cm_accent_generic_html (arg, start, end, html_supported,
00892                             single, html_solo_standalone, html_solo);
00893   else if (no_headers)
00894     cm_accent_generic_no_headers (arg, start, end, single, html_solo);
00895   else if (arg == END)
00896     {
00897       if (enable_encoding)
00898         /* use 8-bit if available */
00899         cm_accent_generic_no_headers (arg, start, end, single, html_solo);
00900       else
00901         /* use regular character */
00902         add_char (single);
00903     }
00904 }
00905 
00906 void
00907 cm_accent_umlaut (int arg, int start, int end)
00908 {
00909   cm_accent_generic (arg, start, end, "aouAOUEeIiy", '"', 1, "uml");
00910 }
00911 
00912 void
00913 cm_accent_acute (int arg, int start, int end)
00914 {
00915   cm_accent_generic (arg, start, end, "AEIOUYaeiouy", '\'', 1, "acute");
00916 }
00917 
00918 void
00919 cm_accent_cedilla (int arg, int start, int end)
00920 {
00921   cm_accent_generic (arg, start, end, "Cc", ',', 1, "cedil");
00922 }
00923 
00924 void
00925 cm_accent_hat (int arg, int start, int end)
00926 {
00927   cm_accent_generic (arg, start, end, "AEIOUaeiou", '^', 0, "circ");
00928 }
00929 
00930 void
00931 cm_accent_grave (int arg, int start, int end)
00932 {
00933   cm_accent_generic (arg, start, end, "AEIOUaeiou", '`', 0, "grave");
00934 }
00935 
00936 void
00937 cm_accent_tilde (int arg, int start, int end)
00938 {
00939   cm_accent_generic (arg, start, end, "ANOano", '~', 0, "tilde");
00940 }
00941 
00942 
00943 
00944 /* Non-English letters/characters that don't insert themselves.  */
00945 void
00946 cm_special_char (int arg)
00947 {
00948   int old_escape_html = escape_html;
00949   escape_html = 0;
00950 
00951   if (arg == START)
00952     {
00953       if ((*command == 'L' || *command == 'l'
00954            || *command == 'O' || *command == 'o')
00955           && command[1] == 0)
00956         { /* Lslash lslash Oslash oslash.
00957              Lslash and lslash aren't supported in HTML.  */
00958           if (command[0] == 'O')
00959             add_encoded_char ("Oslash", "/O");
00960           else if (command[0] == 'o')
00961             add_encoded_char ("oslash", "/o");
00962           else
00963             add_word_args ("/%c", command[0]);
00964         }
00965       else if (strcmp (command, "exclamdown") == 0)
00966         add_encoded_char ("iexcl", "!");
00967       else if (strcmp (command, "questiondown") == 0)
00968         add_encoded_char ("iquest", "?");
00969       else if (strcmp (command, "euro") == 0)
00970         /* http://www.cs.tut.fi/~jkorpela/html/euro.html suggests that
00971            &euro; degrades best in old browsers.  */
00972         add_encoded_char ("euro", "Euro ");
00973       else if (strcmp (command, "pounds") == 0)
00974         add_encoded_char ("pound" , "#");
00975       else if (strcmp (command, "ordf") == 0)
00976         add_encoded_char ("ordf" , "a");
00977       else if (strcmp (command, "ordm") == 0)
00978         add_encoded_char ("ordm" , "o");
00979       else if (strcmp (command, "AE") == 0)
00980         add_encoded_char ("AElig", command);
00981       else if (strcmp (command, "ae") == 0)
00982         add_encoded_char ("aelig",  command);
00983       else if (strcmp (command, "OE") == 0)
00984         add_encoded_char ("OElig", command);
00985       else if (strcmp (command, "oe") == 0)
00986         add_encoded_char ("oelig", command);
00987       else if (strcmp (command, "AA") == 0)
00988         add_encoded_char ("Aring", command);
00989       else if (strcmp (command, "aa") == 0)
00990         add_encoded_char ("aring", command);
00991       else if (strcmp (command, "ss") == 0)
00992         add_encoded_char ("szlig", command);
00993       else
00994         line_error ("cm_special_char internal error: command=@%s", command);
00995     }
00996   escape_html = old_escape_html;
00997 }
00998 
00999 /* Dotless i or j.  */
01000 void
01001 cm_dotless (int arg, int start, int end)
01002 {
01003   if (arg == END)
01004     {
01005       xml_no_para --;
01006       if (output_paragraph[start] != 'i' && output_paragraph[start] != 'j')
01007         /* This error message isn't perfect if the argument is multiple
01008            characters, but it doesn't seem worth getting right.  */
01009         line_error (_("%c%s expects `i' or `j' as argument, not `%c'"),
01010                     COMMAND_PREFIX, command, output_paragraph[start]);
01011 
01012       else if (end - start != 1)
01013         line_error (_("%c%s expects a single character `i' or `j' as argument"),
01014                     COMMAND_PREFIX, command);
01015 
01016       /* We've already inserted the `i' or `j', so nothing to do.  */
01017     }
01018   else
01019     xml_no_para ++;
01020 }