first commit of 2.1 version
[debian/jabref.git] / src / java / net / sf / jabref / Globals.java~
1 /* (C) 2003 Nizar N. Batada, Morten O. Alver
2
3  All programs in this directory and
4  subdirectories are published under the GNU General Public License as
5  described below.
6
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or (at
10  your option) any later version.
11
12  This program is distributed in the hope that it will be useful, but
13  WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  USA
21
22  Further information about the GNU GPL is available at:
23  http://www.gnu.org/copyleft/gpl.ja.html
24
25  */
26 package net.sf.jabref;
27
28 import java.io.* ;
29 import java.nio.charset.Charset;
30 import java.util.* ;
31 import java.util.List;
32 import java.util.logging.* ;
33 import java.util.logging.Filter ;
34
35 import java.awt.* ;
36 import javax.swing.* ;
37
38 import net.sf.jabref.collab.* ;
39 import net.sf.jabref.imports.* ;
40 import net.sf.jabref.util.* ;
41 import net.sf.jabref.journals.JournalAbbreviations;
42
43 public class Globals {
44
45   public static int SHORTCUT_MASK,// = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
46       FUTURE_YEAR = 2050, // Needs to give a year definitely in the future. Used for guessing the
47                           // year field when parsing textual data.  :-)
48
49       STANDARD_EXPORT_COUNT = 5, // The number of standard export formats.
50       METADATA_LINE_LENGTH = 70; // The line length used to wrap metadata.
51
52   private static String resourcePrefix = "resource/JabRef",
53                         menuResourcePrefix = "resource/Menu",
54                         integrityResourcePrefix = "resource/IntegrityMessage";
55   private static final String buildInfos = "/resource/build.properties" ;
56   public static final String additionalFields = "/resource/fields/fields.xml" ;  // some extra field definitions
57   private static String logfile = "jabref.log";
58   public static ResourceBundle messages, menuTitles, intMessages ;
59   public static FileUpdateMonitor fileUpdateMonitor = new FileUpdateMonitor();
60     public static ImportFormatReader importFormatReader = new ImportFormatReader();
61
62   public static ErrorConsole errorConsole;
63
64    public static String VERSION,
65                        BUILD,
66                        BUILD_DATE ;
67
68   static
69   {
70     TBuildInfo bi = new TBuildInfo(buildInfos) ;
71     VERSION = bi.getBUILD_VERSION() ;
72     BUILD = bi.getBUILD_NUMBER() ;
73     BUILD_DATE = bi.getBUILD_DATE() ;
74
75       // TODO: Error console initialization here. When should it be used?
76       errorConsole = ErrorConsole.getInstance();
77   }
78
79
80
81   //public static ResourceBundle preferences = ResourceBundle.getBundle("resource/defaultPrefs");
82   public static Locale locale;
83   public static final String FILETYPE_PREFS_EXT = "_dir",
84       SELECTOR_META_PREFIX = "selector_",
85       LAYOUT_PREFIX = "/resource/layout/",
86       MAC = "Mac OS X",
87       DOI_LOOKUP_PREFIX = "http://dx.doi.org/",
88       NONE = "_non__",
89       FORMATTER_PACKAGE = "net.sf.jabref.export.layout.format.";
90   public static float duplicateThreshold = 0.75f;
91   private static Handler consoleHandler = new java.util.logging.ConsoleHandler();
92   public static String[] ENCODINGS,
93       ALL_ENCODINGS = //(String[]) Charset.availableCharsets().keySet().toArray(new String[]{});
94           new String[] {"ISO8859_1", "UTF8", "UTF-16", "ASCII",
95               "Cp1250", "Cp1251", "Cp1252", "Cp1253", "Cp1254", "Cp1257",
96               "JIS", "SJIS", "EUC-JP",      // Added Japanese encodings.
97               "Big5", "Big5_HKSCS", "GBK",
98               "ISO8859_2", "ISO8859_3", "ISO8859_4", "ISO8859_5", "ISO8859_6",
99               "ISO8859_7", "ISO8859_8", "ISO8859_9", "ISO8859_13", "ISO8859_15"};
100
101   // String array that maps from month number to month string label:
102   public static String[] MONTHS = new String[] {"jan", "feb", "mar", "apr", "may", "jun",
103           "jul", "aug", "sep", "oct", "nov", "dec"};
104
105   // Map that maps from month string labels to
106   public static Map MONTH_STRINGS = new HashMap();
107   static {
108       MONTH_STRINGS.put("jan", "January");
109       MONTH_STRINGS.put("feb", "February");
110       MONTH_STRINGS.put("mar", "March");
111       MONTH_STRINGS.put("apr", "April");
112       MONTH_STRINGS.put("may", "May");
113       MONTH_STRINGS.put("jun", "June");
114       MONTH_STRINGS.put("jul", "July");
115       MONTH_STRINGS.put("aug", "August");
116       MONTH_STRINGS.put("sep", "September");
117       MONTH_STRINGS.put("oct", "October");
118       MONTH_STRINGS.put("nov", "November");
119       MONTH_STRINGS.put("dec", "December");
120
121       // Build list of encodings, by filtering out all that are not supported
122       // on this system:
123       List encodings = new ArrayList();
124       for (int i=0; i<ALL_ENCODINGS.length; i++) {
125           if (Charset.isSupported(ALL_ENCODINGS[i]))
126             encodings.add(ALL_ENCODINGS[i]);
127       }
128       ENCODINGS = (String[])encodings.toArray(new String[0]);
129
130   }
131
132
133   public static GlobalFocusListener focusListener = new GlobalFocusListener();
134   public static JabRefPreferences prefs = null;
135  public static HelpDialog helpDiag = null;
136   public static String osName = System.getProperty("os.name", "def");
137   public static boolean ON_MAC = (osName.equals(MAC)),
138       ON_WIN = osName.startsWith("Windows");
139
140
141   public static String[] SKIP_WORDS = {"a", "an", "the", "for", "on"};
142     public static SidePaneManager sidePaneManager;
143   public static final String NEWLINE = System.getProperty("line.separator");
144     public static final boolean UNIX_NEWLINE = NEWLINE.equals("\n"); // true if we have unix newlines.
145
146     public static final String BIBTEX_STRING = "__string";
147     // "Fieldname" to indicate that a field should be treated as a bibtex string. Used when writing database to file.
148
149     public static void logger(String s) {
150     Logger.global.info(s);
151   }
152
153   public static void turnOffLogging() { // only log exceptions
154     Logger.global.setLevel(java.util.logging.Level.SEVERE);
155   }
156
157   // should be only called once
158   public static void turnOnConsoleLogging() {
159     Logger.global.addHandler(consoleHandler);
160
161   }
162
163
164
165   public static void turnOnFileLogging() {
166     Logger.global.setLevel(java.util.logging.Level.ALL);
167     java.util.logging.Handler handler;
168     handler = new ConsoleHandler();
169     /*try {
170       handler = new FileHandler(logfile); // this will overwrite
171     }
172     catch (IOException e) { //can't open log file so use console
173         e.printStackTrace();
174
175     } */
176     Logger.global.addHandler(handler);
177
178     handler.setFilter(new Filter() { // select what gets logged
179       public boolean isLoggable(LogRecord record) {
180         return true;
181       }
182     });
183   }
184
185   public static void setLanguage(String language, String country) {
186     locale = new Locale(language, country);
187     messages = ResourceBundle.getBundle(resourcePrefix, locale);
188     menuTitles = ResourceBundle.getBundle(menuResourcePrefix, locale);
189     intMessages = ResourceBundle.getBundle(integrityResourcePrefix, locale);
190     Locale.setDefault(locale);
191     javax.swing.JComponent.setDefaultLocale(locale);
192   }
193
194
195   public static JournalAbbreviations journalAbbrev;
196
197
198   public static String lang(String key, String[] params) {
199     String translation = null;
200     try {
201       if (Globals.messages != null) {
202         translation = Globals.messages.getString(key.replaceAll(" ", "_"));
203       }
204     }
205     catch (MissingResourceException ex) {
206       translation = key;
207       
208       //Thread.dumpStack();  // For debugging
209       logger("Warning: could not get translation for \""
210                          + key + "\"");
211     }
212     if ((translation != null) && (translation.length() != 0)) {
213       translation = translation.replaceAll("_", " ");
214       StringBuffer sb = new StringBuffer();
215       boolean b = false;
216       char c;
217       for (int i = 0; i < translation.length(); ++i) {
218           c = translation.charAt(i);
219           if (c == '%') {
220               b = true;
221           } else {
222               if (!b) {
223                   sb.append(c);
224               } else {
225                   b = false;
226                   try {
227                       int index = Integer.parseInt(String.valueOf(c));
228                       if (params != null && index >= 0 && index <= params.length)
229                           sb.append(params[index]);
230                   } catch (NumberFormatException e) {
231                       // append literally (for quoting) or insert special symbol
232                       switch (c) {
233                       case 'c': // colon
234                           sb.append(':');
235                           break;
236                       case 'e': // equal
237                           sb.append('=');
238                           break;
239                       default: // anything else, e.g. %
240                           sb.append(c);
241                       }
242                   }
243               }
244           }
245       }
246       return sb.toString();
247     }
248     return key;
249   }
250
251   public static String lang(String key) {
252       return lang(key, (String[])null);
253   }
254
255   public static String lang(String key, String s1) {
256       return lang(key, new String[]{s1});
257   }
258
259   public static String lang(String key, String s1, String s2) {
260       return lang(key, new String[]{s1, s2});
261   }
262
263   public static String lang(String key, String s1, String s2, String s3) {
264       return lang(key, new String[]{s1, s2, s3});
265   }
266
267   public static String menuTitle(String key) {
268     String translation = null;
269     try {
270       if (Globals.messages != null) {
271         translation = Globals.menuTitles.getString(key.replaceAll(" ", "_"));
272       }
273     }
274     catch (MissingResourceException ex) {
275       translation = key;
276
277       //System.err.println("Warning: could not get menu item translation for \""
278       //                   + key + "\"");
279
280     }
281     if ((translation != null) && (translation.length() != 0)) {
282       return translation.replaceAll("_", " ");
283     }
284     else {
285       return key;
286     }
287   }
288
289   public static String getIntegrityMessage(String key)
290   {
291     String translation = null;
292     try {
293       if (Globals.intMessages != null) {
294         translation = Globals.intMessages.getString(key);
295       }
296     }
297     catch (MissingResourceException ex) {
298       translation = key;
299
300 //      System.err.println("Warning: could not get menu item translation for \""
301 //                         + key + "\"");
302     }
303     if ((translation != null) && (translation.length() != 0)) {
304       return translation ;
305     }
306     else {
307       return key;
308     }
309   }
310
311
312   //============================================================
313   // Using the hashmap of entry types found in BibtexEntryType
314   //============================================================
315   public static BibtexEntryType getEntryType(String type) {
316     // decide which entryType object to return
317     Object o = BibtexEntryType.ALL_TYPES.get(type);
318     if (o != null) {
319       return (BibtexEntryType) o;
320     }
321     else {
322       return BibtexEntryType.OTHER;
323     }
324     /*
325       if(type.equals("article"))
326         return BibtexEntryType.ARTICLE;
327       else if(type.equals("book"))
328         return BibtexEntryType.BOOK;
329       else if(type.equals("inproceedings"))
330         return BibtexEntryType.INPROCEEDINGS;
331      */
332   }
333
334     /**
335      * This method provides the correct opening brace to use when writing a field
336      * to BibTeX format.
337      * @return A String containing the braces to use.
338      */
339     public static String getOpeningBrace() {
340         return "{";
341         /*
342             As of version 2.0, storing all fields with double braces is no longer supported, because
343             it causes problems with e.g. the author field.
344
345         if (prefs.getBoolean("autoDoubleBraces"))
346             return "{{";
347         else
348             return "{";
349         */
350     }
351
352     /**
353      * This method provides the correct closing brace to use when writing a field
354      * to BibTeX format.
355      * @return A String containing the braces to use.
356      */
357     public static String getClosingBrace() {
358         return "}";
359         /*
360             As of version 2.0, storing all fields with double braces is no longer supported, because
361             it causes problems with e.g. the author field.
362
363         if (prefs.getBoolean("autoDoubleBraces"))
364             return "}}";
365         else
366         */
367
368     }
369
370     /*    public static void setupKeyBindings(JabRefPreferences prefs) {
371     }*/
372
373
374     public static String[] getMultipleFiles(JFrame owner,
375                                           File directory, String extension,
376                                           boolean updateWorkingdirectory) {
377
378         OpenFileFilter off = null;
379         if (extension == null)
380           off = new OpenFileFilter();
381         else if (!extension.equals(NONE))
382           off = new OpenFileFilter(extension);
383         Object o = getNewFileImpl(owner, directory, extension, null, off,
384                 JFileChooser.OPEN_DIALOG, updateWorkingdirectory, false, true);
385         String[] toReturn;
386         if (o instanceof String[])
387             toReturn = (String[])o;
388         else toReturn = new String[] {(String)o};
389
390         return toReturn;
391     }
392
393   public static String getNewFile(JFrame owner,
394                                   File directory, String extension,
395                                   int dialogType,
396                                   boolean updateWorkingDirectory) {
397     return getNewFile(owner, directory, extension, null, dialogType,
398                       updateWorkingDirectory, false);
399   }
400
401
402   public static String getNewFile(JFrame owner,
403                                   File directory, String extension,
404                                   String description,
405                                   int dialogType,
406                                   boolean updateWorkingDirectory) {
407     return getNewFile(owner, directory, extension, description, dialogType,
408                       updateWorkingDirectory, false);
409   }
410
411
412   public static String getNewDir(JFrame owner,
413                                  File directory, String extension,
414                                  int dialogType, boolean updateWorkingDirectory) {
415     return getNewFile(owner, directory, extension, null, dialogType,
416                       updateWorkingDirectory, true);
417   }
418
419   public static String getNewDir(JFrame owner,
420                                  File directory, String extension,
421                                  String description,
422                                  int dialogType, boolean updateWorkingDirectory) {
423     return getNewFile(owner, directory, extension, description, dialogType,
424                       updateWorkingDirectory, true);
425   }
426
427   private static String getNewFile(JFrame owner,
428                                    File directory, String extension,
429                                    String description,
430                                    int dialogType,
431                                    boolean updateWorkingDirectory,
432                                    boolean dirOnly) {
433
434     OpenFileFilter off = null;
435
436     if (extension == null)
437       off = new OpenFileFilter();
438     else if (!extension.equals(NONE))
439       off = new OpenFileFilter(extension);
440
441     return (String)getNewFileImpl(owner, directory, extension, description, off,
442             dialogType, updateWorkingDirectory, dirOnly, false);
443   }
444
445   private static Object getNewFileImpl(JFrame owner,
446                                        File directory, String extension,
447                                        String description,
448                                        OpenFileFilter off,
449                                        int dialogType,
450                                        boolean updateWorkingDirectory,
451                                        boolean dirOnly,
452                                        boolean multipleSelection) {
453
454       if (ON_MAC && prefs.getBoolean("useNativeFileDialogOnMac")) {
455
456           return getNewFileForMac(owner, directory, extension, dialogType,
457                 updateWorkingDirectory, dirOnly, off);
458       }
459
460       JFileChooser fc = null;
461       try {
462           fc = new JabRefFileChooser(directory);
463       } catch (InternalError errl) {
464           // This try/catch clause was added because a user reported an
465           // InternalError getting thrown on WinNT, presumably because of a
466           // bug in JGoodies Windows PLAF. This clause can be removed if the
467           // bug is fixed, but for now we just resort to the native file
468           // dialog, using the same method as is always used on Mac:
469           return getNewFileForMac(owner, directory, extension, dialogType,
470                   updateWorkingDirectory, dirOnly, off);
471       }
472
473       if (dirOnly) {
474           fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
475
476       }
477
478       fc.setMultiSelectionEnabled(multipleSelection);
479
480       fc.addChoosableFileFilter(off);
481       fc.setDialogType(dialogType);
482       int dialogResult;
483       if (dialogType == JFileChooser.OPEN_DIALOG) {
484           dialogResult = fc.showOpenDialog(owner);
485       } else if (dialogType == JFileChooser.SAVE_DIALOG) {
486           dialogResult = fc.showSaveDialog(owner);
487       } else {
488           dialogResult = fc.showDialog(owner, description);
489       }
490
491       // the getSelectedFile method returns a valid fileselection
492       // (if something is selected) indepentently from dialog return status
493       if (dialogResult != JFileChooser.APPROVE_OPTION)
494           return null;
495
496       // okay button
497       File selectedFile = fc.getSelectedFile();
498       if (selectedFile == null) { // cancel
499           return null;
500       }
501
502       // If this is a save dialog, and the user has not chosen "All files" as filter
503       // we enforce the given extension. But only if extension is not null.
504       if ((extension != null) && (dialogType == JFileChooser.SAVE_DIALOG) && (fc.getFileFilter() == off) &&
505               !off.accept(selectedFile)) {
506
507           // add the first extension if there are multiple extensions
508           selectedFile = new File(selectedFile.getPath() + extension.split("[, ]+", 0)[0]);
509       }
510
511       if (updateWorkingDirectory) {
512           prefs.put("workingDirectory", selectedFile.getPath());
513       }
514
515       if (!multipleSelection)
516         return selectedFile.getAbsolutePath();
517       else {
518           File[] files = fc.getSelectedFiles();
519           String[] filenames = new String[files.length];
520           for (int i=0; i<files.length; i++)
521             filenames[i] = files[i].getAbsolutePath();
522           return filenames;
523       }
524   }
525
526   private static String getNewFileForMac(JFrame owner,
527                                          File directory, String extensions,
528                                          int dialogType,
529                                          boolean updateWorkingDirectory,
530                                          boolean dirOnly,
531                                          FilenameFilter filter) {
532
533     FileDialog fc = new FileDialog(owner);
534     
535     //fc.setFilenameFilter(filter);
536     if (directory != null) {
537       fc.setDirectory(directory.getParent());
538     }
539     if (dialogType == JFileChooser.OPEN_DIALOG) {
540       fc.setMode(FileDialog.LOAD);
541     }
542     else {
543       fc.setMode(FileDialog.SAVE);
544     }
545
546     fc.setVisible(true); // fc.show(); -> deprecated since 1.5
547
548     if (fc.getFile() != null) {
549       Globals.prefs.put("workingDirectory", fc.getDirectory() + fc.getFile());
550       return fc.getDirectory() + fc.getFile();
551     }
552     else {
553       return null;
554     }
555   }
556
557
558   public static String SPECIAL_COMMAND_CHARS = "\"`^~'c";
559   public static HashMap HTML_CHARS = new HashMap(),
560           HTMLCHARS = new HashMap(),
561       XML_CHARS = new HashMap(),
562       ASCII2XML_CHARS = new HashMap(),
563       UNICODE_CHARS = new HashMap(),
564       RTFCHARS = new HashMap(),
565         URL_CHARS = new HashMap();
566   static {
567
568       //System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", true));
569       //System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", false));
570       //System.out.println(journalAbbrev.getFullName("Aquaculture Eng."));
571       /*for (Iterator i=journalAbbrev.fullNameIterator(); i.hasNext();) {
572           String s = (String)i.next();
573           System.out.println(journalAbbrev.getFullName(s)+" : "+journalAbbrev.getAbbreviatedName(s, true));
574       } */
575
576     // Start the thread that monitors file time stamps.
577     //Util.pr("Starting FileUpdateMonitor thread. Globals line 293.");
578     fileUpdateMonitor.start();
579
580     try {
581       SHORTCUT_MASK = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
582     } catch (Throwable t) {
583
584     }
585
586       // Special characters in URLs need to be replaced to ensure that the URL
587       // opens properly on all platforms:
588       URL_CHARS.put("<", "%3c");
589       URL_CHARS.put(">", "%3e");
590       URL_CHARS.put("(", "%28");
591       URL_CHARS.put(")", "%29");
592       URL_CHARS.put(" ", "%20");
593       URL_CHARS.put("&", "%26");
594       URL_CHARS.put("$", "%24");
595
596
597
598 //    HTMLCHARS.put("\"a", "&auml;");
599 //    HTMLCHARS.put("\"A", "&Auml;");
600 //    HTMLCHARS.put("\"e", "&euml;");
601 //    HTMLCHARS.put("\"E", "&Euml;");
602 //    HTMLCHARS.put("\"i", "&iuml;");
603 //    HTMLCHARS.put("\"I", "&Iuml;");
604 //    HTMLCHARS.put("\"o", "&ouml;");
605 //    HTMLCHARS.put("\"O", "&Ouml;");
606 //    HTMLCHARS.put("\"u", "&uuml;");
607 //    HTMLCHARS.put("\"U", "&Uuml;");
608 //    HTMLCHARS.put("`a", "&agrave;");
609 //    HTMLCHARS.put("`A", "&Agrave;");
610 //    HTMLCHARS.put("`e", "&egrave;");
611 //    HTMLCHARS.put("`E", "&Egrave;");
612 //    HTMLCHARS.put("`i", "&igrave;");
613 //    HTMLCHARS.put("`I", "&Igrave;");
614 //    HTMLCHARS.put("`o", "&ograve;");
615 //    HTMLCHARS.put("`O", "&Ograve;");
616 //    HTMLCHARS.put("`u", "&ugrave;");
617 //    HTMLCHARS.put("`U", "&Ugrave;");
618 //    HTMLCHARS.put("'e", "&eacute;");
619 //    HTMLCHARS.put("'E", "&Eacute;");
620 //    HTMLCHARS.put("'i", "&iacute;");
621 //    HTMLCHARS.put("'I", "&Iacute;");
622 //    HTMLCHARS.put("'o", "&oacute;");
623 //    HTMLCHARS.put("'O", "&Oacute;");
624 //    HTMLCHARS.put("'u", "&uacute;");
625 //    HTMLCHARS.put("'U", "&Uacute;");
626 //    HTMLCHARS.put("'a", "&aacute;");
627 //    HTMLCHARS.put("'A", "&Aacute;");
628 //    HTMLCHARS.put("^a", "&ocirc;");
629 //    HTMLCHARS.put("^A", "&Ocirc;");
630 //    HTMLCHARS.put("^o", "&ocirc;");
631 //    HTMLCHARS.put("^O", "&Ocirc;");
632 //    HTMLCHARS.put("^u", "&ucirc;");
633 //    HTMLCHARS.put("^U", "&Ucirc;");
634 //    HTMLCHARS.put("^e", "&ecirc;");
635 //    HTMLCHARS.put("^E", "&Ecirc;");
636 //    HTMLCHARS.put("^i", "&icirc;");
637 //    HTMLCHARS.put("^I", "&Icirc;");
638 //    HTMLCHARS.put("~o", "&otilde;");
639 //    HTMLCHARS.put("~O", "&Otilde;");
640 //    HTMLCHARS.put("~n", "&ntilde;");
641 //    HTMLCHARS.put("~N", "&Ntilde;");
642 //    HTMLCHARS.put("~a", "&atilde;");
643 //    HTMLCHARS.put("~A", "&Atilde;");
644 //    HTMLCHARS.put("cc", "&ccedil;");
645 //    HTMLCHARS.put("cC", "&Ccedil;");
646
647
648       // Following character definitions contributed by Ervin Kolenovic:
649       // HTML named entities from #192 - #255 (UNICODE Latin-1)
650        HTMLCHARS.put("`A", "&Agrave;");    // #192
651        HTMLCHARS.put("'A", "&Aacute;");    // #193
652        HTMLCHARS.put("^A", "&Acirc;");     // #194
653        HTMLCHARS.put("~A", "&Atilde;");    // #195
654        HTMLCHARS.put("\"A", "&Auml;");     // #196
655        HTMLCHARS.put("AA", "&Aring;");     // #197
656        HTMLCHARS.put("AE", "&AElig;");     // #198
657        HTMLCHARS.put("cC", "&Ccedil;");    // #199
658        HTMLCHARS.put("`E", "&Egrave;");    // #200
659        HTMLCHARS.put("'E", "&Eacute;");    // #201
660        HTMLCHARS.put("^E", "&Ecirc;");     // #202
661        HTMLCHARS.put("\"E", "&Euml;");     // #203
662        HTMLCHARS.put("`I", "&Igrave;");    // #204
663        HTMLCHARS.put("'I", "&Iacute;");    // #205
664        HTMLCHARS.put("^I", "&Icirc;");     // #206
665        HTMLCHARS.put("\"I", "&Iuml;");     // #207
666        HTMLCHARS.put("DH", "&ETH;");       // #208
667        HTMLCHARS.put("~N", "&Ntilde;");    // #209
668        HTMLCHARS.put("`O", "&Ograve;");    // #210
669        HTMLCHARS.put("'O", "&Oacute;");    // #211
670        HTMLCHARS.put("^O", "&Ocirc;");     // #212
671        HTMLCHARS.put("~O", "&Otilde;");    // #213
672        HTMLCHARS.put("\"O", "&Ouml;");     // #214
673        // According to ISO 8859-1 the "\times" symbol should be placed here (#215).
674        // Omitting this, because it is a mathematical symbol.
675        HTMLCHARS.put("O", "&OSlash;");     // #216
676        HTMLCHARS.put("`U", "&Ugrave;");    // #217
677        HTMLCHARS.put("'U", "&Uacute;");    // #218
678        HTMLCHARS.put("^U", "&Ucirc;");     // #219
679        HTMLCHARS.put("\"U", "&Uuml;");     // #220
680        HTMLCHARS.put("'Y", "&Yacute;");    // #221
681        HTMLCHARS.put("TH", "&THORN;");     // #222
682        HTMLCHARS.put("ss", "&szlig;");     // #223
683        HTMLCHARS.put("`a", "&agrave;");    // #224
684        HTMLCHARS.put("'a", "&aacute;");    // #225
685        HTMLCHARS.put("^a", "&acirc;");     // #226
686        HTMLCHARS.put("~a", "&atilde;");    // #227
687        HTMLCHARS.put("\"a", "&auml;");     // #228
688        HTMLCHARS.put("aa", "&aring;");     // #229
689        HTMLCHARS.put("ae", "&aelig;");     // #230
690        HTMLCHARS.put("cc", "&ccedil;");    // #231
691        HTMLCHARS.put("`e", "&egrave;");    // #232
692        HTMLCHARS.put("'e", "&eacute;");    // #233
693        HTMLCHARS.put("^e", "&ecirc;");     // #234
694        HTMLCHARS.put("\"e", "&euml;");     // #235
695        HTMLCHARS.put("`i", "&igrave;");    // #236
696        HTMLCHARS.put("'i", "&iacute;");    // #237
697        HTMLCHARS.put("^i", "&icirc;");     // #238
698        HTMLCHARS.put("\"i", "&iuml;");     // #239
699        HTMLCHARS.put("dh", "&eth;");       // #240
700        HTMLCHARS.put("~n", "&ntilde;");    // #241
701        HTMLCHARS.put("`o", "&ograve;");    // #242
702        HTMLCHARS.put("'o", "&oacute;");    // #243
703        HTMLCHARS.put("^o", "&ocirc;");     // #244
704        HTMLCHARS.put("~o", "&otilde;");    // #245
705        HTMLCHARS.put("\"o", "&ouml;");     // #246
706        // According to ISO 8859-1 the "\div" symbol should be placed here (#247).
707        // Omitting this, because it is a mathematical symbol.
708        HTMLCHARS.put("o", "&oslash;");     // #248
709        HTMLCHARS.put("`u", "&ugrave;");    // #249
710        HTMLCHARS.put("'u", "&uacute;");    // #250
711        HTMLCHARS.put("^u", "&ucirc;");     // #251
712        HTMLCHARS.put("\"u", "&uuml;");     // #252
713        HTMLCHARS.put("'y", "&yacute;");    // #253
714        HTMLCHARS.put("th", "&thorn;");     // #254
715        HTMLCHARS.put("\"y", "&yuml;");     // #255
716
717        // HTML special characters without names (UNICODE Latin Extended-A), indicated by UNICODE number
718        HTMLCHARS.put("=A", "&#256;");      // "Amacr"
719        HTMLCHARS.put("=a", "&#257;");      // "amacr"
720        HTMLCHARS.put("uA", "&#258;");      // "Abreve"
721        HTMLCHARS.put("ua", "&#259;");      // "abreve"
722        HTMLCHARS.put("kA", "&#260;");      // "Aogon"
723        HTMLCHARS.put("ka", "&#261;");      // "aogon"
724        HTMLCHARS.put("'C", "&#262;");      // "Cacute"
725        HTMLCHARS.put("'c", "&#263;");      // "cacute"
726        HTMLCHARS.put("^C", "&#264;");      // "Ccirc"
727        HTMLCHARS.put("^c", "&#265;");      // "ccirc"
728        HTMLCHARS.put(".C", "&#266;");      // "Cdot"
729        HTMLCHARS.put(".c", "&#267;");      // "cdot"
730        HTMLCHARS.put("vC", "&#268;");      // "Ccaron"
731        HTMLCHARS.put("vc", "&#269;");      // "ccaron"
732        HTMLCHARS.put("vD", "&#270;");      // "Dcaron"
733        // Symbol #271 (d´) has no special Latex command
734        HTMLCHARS.put("DJ", "&#272;");      // "Dstrok"
735        HTMLCHARS.put("dj", "&#273;");      // "dstrok"
736        HTMLCHARS.put("=E", "&#274;");      // "Emacr"
737        HTMLCHARS.put("=e", "&#275;");      // "emacr"
738        HTMLCHARS.put("uE", "&#276;");      // "Ebreve"
739        HTMLCHARS.put("ue", "&#277;");      // "ebreve"
740        HTMLCHARS.put(".E", "&#278;");      // "Edot"
741        HTMLCHARS.put(".e", "&#279;");      // "edot"
742        HTMLCHARS.put("kE", "&#280;");      // "Eogon"
743        HTMLCHARS.put("ke", "&#281;");      // "eogon"
744        HTMLCHARS.put("vE", "&#282;");      // "Ecaron"
745        HTMLCHARS.put("ve", "&#283;");      // "ecaron"
746        HTMLCHARS.put("^G", "&#284;");      // "Gcirc"
747        HTMLCHARS.put("^g", "&#285;");      // "gcirc"
748        HTMLCHARS.put("uG", "&#286;");      // "Gbreve"
749        HTMLCHARS.put("ug", "&#287;");      // "gbreve"
750        HTMLCHARS.put(".G", "&#288;");      // "Gdot"
751        HTMLCHARS.put(".g", "&#289;");      // "gdot"
752        HTMLCHARS.put("cG", "&#290;");      // "Gcedil"
753        HTMLCHARS.put("'g", "&#291;");      // "gacute"
754        HTMLCHARS.put("^H", "&#292;");      // "Hcirc"
755        HTMLCHARS.put("^h", "&#293;");      // "hcirc"
756        HTMLCHARS.put("Hstrok", "&#294;");  // "Hstrok"
757        HTMLCHARS.put("hstrok", "&#295;");  // "hstrok"
758        HTMLCHARS.put("~I", "&#296;");      // "Itilde"
759        HTMLCHARS.put("~i", "&#297;");      // "itilde"
760        HTMLCHARS.put("=I", "&#298;");      // "Imacr"
761        HTMLCHARS.put("=i", "&#299;");      // "imacr"
762        HTMLCHARS.put("uI", "&#300;");      // "Ibreve"
763        HTMLCHARS.put("ui", "&#301;");      // "ibreve"
764        HTMLCHARS.put("kI", "&#302;");      // "Iogon"
765        HTMLCHARS.put("ki", "&#303;");      // "iogon"
766        HTMLCHARS.put(".I", "&#304;");      // "Idot"
767        HTMLCHARS.put("i", "&#305;");       // "inodot"
768        // Symbol #306 (IJ) has no special Latex command
769        // Symbol #307 (ij) has no special Latex command
770        HTMLCHARS.put("^J", "&#308;");      // "Jcirc"
771        HTMLCHARS.put("^j", "&#309;");      // "jcirc"
772        HTMLCHARS.put("cK", "&#310;");      // "Kcedil"
773        HTMLCHARS.put("ck", "&#311;");      // "kcedil"
774        // Symbol #312 (k) has no special Latex command
775        HTMLCHARS.put("'L", "&#313;");      // "Lacute"
776        HTMLCHARS.put("'l", "&#314;");      // "lacute"
777        HTMLCHARS.put("cL", "&#315;");      // "Lcedil"
778        HTMLCHARS.put("cl", "&#316;");      // "lcedil"
779        // Symbol #317 (L´) has no special Latex command
780        // Symbol #318 (l´) has no special Latex command
781        HTMLCHARS.put("Lmidot", "&#319;");      // "Lmidot"
782        HTMLCHARS.put("lmidot", "&#320;");      // "lmidot"
783        HTMLCHARS.put("L", "&#321;");      // "Lstrok"
784        HTMLCHARS.put("l", "&#322;");      // "lstrok"
785        HTMLCHARS.put("'N", "&#323;");      // "Nacute"
786        HTMLCHARS.put("'n", "&#324;");      // "nacute"
787        HTMLCHARS.put("cN", "&#325;");      // "Ncedil"
788        HTMLCHARS.put("cn", "&#326;");      // "ncedil"
789        HTMLCHARS.put("vN", "&#327;");      // "Ncaron"
790        HTMLCHARS.put("vn", "&#328;");      // "ncaron"
791        // Symbol #329 (´n) has no special Latex command
792        HTMLCHARS.put("NG", "&#330;");      // "ENG"
793        HTMLCHARS.put("ng", "&#331;");      // "eng"
794        HTMLCHARS.put("=O", "&#332;");      // "Omacr"
795        HTMLCHARS.put("=o", "&#333;");      // "omacr"
796        HTMLCHARS.put("uO", "&#334;");      // "Obreve"
797        HTMLCHARS.put("uo", "&#335;");      // "obreve"
798        HTMLCHARS.put("HO", "&#336;");      // "Odblac"
799        HTMLCHARS.put("Ho", "&#337;");      // "odblac"
800        HTMLCHARS.put("OE", "&#338;");      // "OElig"
801        HTMLCHARS.put("oe", "&#339;");      // "oelig"
802        HTMLCHARS.put("'R", "&#340;");      // "Racute"
803        HTMLCHARS.put("'r", "&#341;");      // "racute"
804        HTMLCHARS.put("cR", "&#342;");      // "Rcedil"
805        HTMLCHARS.put("cr", "&#343;");      // "rcedil"
806        HTMLCHARS.put("vR", "&#344;");      // "Rcaron"
807        HTMLCHARS.put("vr", "&#345;");      // "rcaron"
808        HTMLCHARS.put("'S", "&#346;");      // "Sacute"
809        HTMLCHARS.put("'s", "&#347;");      // "sacute"
810        HTMLCHARS.put("^S", "&#348;");      // "Scirc"
811        HTMLCHARS.put("^s", "&#349;");      // "scirc"
812        HTMLCHARS.put("cS", "&#350;");      // "Scedil"
813        HTMLCHARS.put("cs", "&#351;");      // "scedil"
814        HTMLCHARS.put("vS", "&#352;");      // "Scaron"
815        HTMLCHARS.put("vs", "&#353;");      // "scaron"
816        HTMLCHARS.put("cT", "&#354;");      // "Tcedil"
817        HTMLCHARS.put("ct", "&#355;");      // "tcedil"
818        HTMLCHARS.put("vT", "&#356;");      // "Tcaron"
819        // Symbol #357 (t´) has no special Latex command
820        HTMLCHARS.put("Tstrok", "&#358;");  // "Tstrok"
821        HTMLCHARS.put("tstrok", "&#359;");  // "tstrok"
822        HTMLCHARS.put("~U", "&#360;");      // "Utilde"
823        HTMLCHARS.put("~u", "&#361;");      // "utilde"
824        HTMLCHARS.put("=U", "&#362;");      // "Umacr"
825        HTMLCHARS.put("=u", "&#363;");      // "umacr"
826        HTMLCHARS.put("uU", "&#364;");      // "Ubreve"
827        HTMLCHARS.put("uu", "&#365;");      // "ubreve"
828        HTMLCHARS.put("rU", "&#366;");      // "Uring"
829        HTMLCHARS.put("ru", "&#367;");      // "uring"
830        HTMLCHARS.put("HU", "&#368;");      // "Odblac"
831        HTMLCHARS.put("Hu", "&#369;");      // "odblac"
832        HTMLCHARS.put("kU", "&#370;");      // "Uogon"
833        HTMLCHARS.put("ku", "&#371;");      // "uogon"
834        HTMLCHARS.put("^W", "&#372;");      // "Wcirc"
835        HTMLCHARS.put("^w", "&#373;");      // "wcirc"
836        HTMLCHARS.put("^Y", "&#374;");      // "Ycirc"
837        HTMLCHARS.put("^y", "&#375;");      // "ycirc"
838        HTMLCHARS.put("\"Y", "&#376;");     // "Yuml"
839        HTMLCHARS.put("'Z", "&#377;");      // "Zacute"
840        HTMLCHARS.put("'z", "&#378;");      // "zacute"
841        HTMLCHARS.put(".Z", "&#379;");      // "Zdot"
842        HTMLCHARS.put(".z", "&#380;");      // "zdot"
843        HTMLCHARS.put("vZ", "&#381;");      // "Zcaron"
844        HTMLCHARS.put("vz", "&#382;");      // "zcaron"
845        // Symbol #383 (f) has no special Latex command
846
847
848     XML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "&#x00E4;");
849     XML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "&#x00C4;");
850     XML_CHARS.put("\\{\\\\\\\"\\{e\\}\\}", "&#x00EB;");
851     XML_CHARS.put("\\{\\\\\\\"\\{E\\}\\}", "&#x00CB;");
852     XML_CHARS.put("\\{\\\\\\\"\\{i\\}\\}", "&#x00EF;");
853     XML_CHARS.put("\\{\\\\\\\"\\{I\\}\\}", "&#x00CF;");
854     XML_CHARS.put("\\{\\\\\\\"\\{o\\}\\}", "&#x00F6;");
855     XML_CHARS.put("\\{\\\\\\\"\\{O\\}\\}", "&#x00D6;");
856     XML_CHARS.put("\\{\\\\\\\"\\{u\\}\\}", "&#x00FC;");
857     XML_CHARS.put("\\{\\\\\\\"\\{U\\}\\}", "&#x00DC;");
858
859     XML_CHARS.put("\\{\\\\\\`\\{e\\}\\}", "&#x00E8;");
860     XML_CHARS.put("\\{\\\\\\`\\{E\\}\\}", "&#x00C8;");
861     XML_CHARS.put("\\{\\\\\\`\\{i\\}\\}", "&#x00EC;");
862     XML_CHARS.put("\\{\\\\\\`\\{I\\}\\}", "&#x00CC;");
863     XML_CHARS.put("\\{\\\\\\`\\{o\\}\\}", "&#x00F2;");
864     XML_CHARS.put("\\{\\\\\\`\\{O\\}\\}", "&#x00D2;");
865     XML_CHARS.put("\\{\\\\\\`\\{u\\}\\}", "&#x00F9;");
866     XML_CHARS.put("\\{\\\\\\`\\{U\\}\\}", "&#x00D9;");
867     XML_CHARS.put("\\{\\\\\\'\\{e\\}\\}", "&#x00E9;");
868     XML_CHARS.put("\\{\\\\\\\uFFFD\\{E\\}\\}", "&#x00C9;");
869     XML_CHARS.put("\\{\\\\\\\uFFFD\\{i\\}\\}", "&#x00ED;");
870     XML_CHARS.put("\\{\\\\\\\uFFFD\\{I\\}\\}", "&#x00CD;");
871     XML_CHARS.put("\\{\\\\\\\uFFFD\\{o\\}\\}", "&#x00F3;");
872     XML_CHARS.put("\\{\\\\\\\uFFFD\\{O\\}\\}", "&#x00D3;");
873     XML_CHARS.put("\\{\\\\\\\uFFFD\\{u\\}\\}", "&#x00FA;");
874     XML_CHARS.put("\\{\\\\\\\uFFFD\\{U\\}\\}", "&#x00DA;");
875     XML_CHARS.put("\\{\\\\\\\uFFFD\\{a\\}\\}", "&#x00E1;");
876     XML_CHARS.put("\\{\\\\\\\uFFFD\\{A\\}\\}", "&#x00C1;");
877
878     XML_CHARS.put("\\{\\\\\\^\\{o\\}\\}", "&#x00F4;");
879     XML_CHARS.put("\\{\\\\\\^\\{O\\}\\}", "&#x00D4;");
880     XML_CHARS.put("\\{\\\\\\^\\{u\\}\\}", "&#x00F9;");
881     XML_CHARS.put("\\{\\\\\\^\\{U\\}\\}", "&#x00D9;");
882     XML_CHARS.put("\\{\\\\\\^\\{e\\}\\}", "&#x00EA;");
883     XML_CHARS.put("\\{\\\\\\^\\{E\\}\\}", "&#x00CA;");
884     XML_CHARS.put("\\{\\\\\\^\\{i\\}\\}", "&#x00EE;");
885     XML_CHARS.put("\\{\\\\\\^\\{I\\}\\}", "&#x00CE;");
886     XML_CHARS.put("\\{\\\\\\~\\{o\\}\\}", "&#x00F5;");
887     XML_CHARS.put("\\{\\\\\\~\\{O\\}\\}", "&#x00D5;");
888     XML_CHARS.put("\\{\\\\\\~\\{n\\}\\}", "&#x00F1;");
889     XML_CHARS.put("\\{\\\\\\~\\{N\\}\\}", "&#x00D1;");
890     XML_CHARS.put("\\{\\\\\\~\\{a\\}\\}", "&#x00E3;");
891     XML_CHARS.put("\\{\\\\\\~\\{A\\}\\}", "&#x00C3;");
892
893
894     XML_CHARS.put("\\{\\\\\\\"a\\}", "&#x00E4;");
895     XML_CHARS.put("\\{\\\\\\\"A\\}", "&#x00C4;");
896     XML_CHARS.put("\\{\\\\\\\"e\\}", "&#x00EB;");
897     XML_CHARS.put("\\{\\\\\\\"E\\}", "&#x00CB;");
898     XML_CHARS.put("\\{\\\\\\\"i\\}", "&#x00EF;");
899     XML_CHARS.put("\\{\\\\\\\"I\\}", "&#x00CF;");
900     XML_CHARS.put("\\{\\\\\\\"o\\}", "&#x00F6;");
901     XML_CHARS.put("\\{\\\\\\\"O\\}", "&#x00D6;");
902     XML_CHARS.put("\\{\\\\\\\"u\\}", "&#x00FC;");
903     XML_CHARS.put("\\{\\\\\\\"U\\}", "&#x00DC;");
904
905     XML_CHARS.put("\\{\\\\\\`e\\}", "&#x00E8;");
906     XML_CHARS.put("\\{\\\\\\`E\\}", "&#x00C8;");
907     XML_CHARS.put("\\{\\\\\\`i\\}", "&#x00EC;");
908     XML_CHARS.put("\\{\\\\\\`I\\}", "&#x00CC;");
909     XML_CHARS.put("\\{\\\\\\`o\\}", "&#x00F2;");
910     XML_CHARS.put("\\{\\\\\\`O\\}", "&#x00D2;");
911     XML_CHARS.put("\\{\\\\\\`u\\}", "&#x00F9;");
912     XML_CHARS.put("\\{\\\\\\`U\\}", "&#x00D9;");
913     XML_CHARS.put("\\{\\\\\\'e\\}", "&#x00E9;");
914     XML_CHARS.put("\\{\\\\\\'E\\}", "&#x00C9;");
915     XML_CHARS.put("\\{\\\\\\'i\\}", "&#x00ED;");
916     XML_CHARS.put("\\{\\\\\\'I\\}", "&#x00CD;");
917     XML_CHARS.put("\\{\\\\\\'o\\}", "&#x00F3;");
918     XML_CHARS.put("\\{\\\\\\'O\\}", "&#x00D3;");
919     XML_CHARS.put("\\{\\\\\\'u\\}", "&#x00FA;");
920     XML_CHARS.put("\\{\\\\\\'U\\}", "&#x00DA;");
921     XML_CHARS.put("\\{\\\\\\'a\\}", "&#x00E1;");
922     XML_CHARS.put("\\{\\\\\\'A\\}", "&#x00C1;");
923
924     XML_CHARS.put("\\{\\\\\\^a\\}", "&#x00F4;");
925     XML_CHARS.put("\\{\\\\\\^A\\}", "&#x00D4;");
926     XML_CHARS.put("\\{\\\\\\^o\\}", "&#x00F4;");
927     XML_CHARS.put("\\{\\\\\\^O\\}", "&#x00D4;");
928     XML_CHARS.put("\\{\\\\\\^u\\}", "&#x00F9;");
929     XML_CHARS.put("\\{\\\\\\^U\\}", "&#x00D9;");
930     XML_CHARS.put("\\{\\\\\\^e\\}", "&#x00EA;");
931     XML_CHARS.put("\\{\\\\\\^E\\}", "&#x00CA;");
932     XML_CHARS.put("\\{\\\\\\^i\\}", "&#x00EE;");
933     XML_CHARS.put("\\{\\\\\\^I\\}", "&#x00CE;");
934     XML_CHARS.put("\\{\\\\\\~o\\}", "&#x00F5;");
935     XML_CHARS.put("\\{\\\\\\~O\\}", "&#x00D5;");
936     XML_CHARS.put("\\{\\\\\\~n\\}", "&#x00F1;");
937     XML_CHARS.put("\\{\\\\\\~N\\}", "&#x00D1;");
938     XML_CHARS.put("\\{\\\\\\~a\\}", "&#x00E3;");
939     XML_CHARS.put("\\{\\\\\\~A\\}", "&#x00C3;");
940
941     ASCII2XML_CHARS.put("<", "&lt;");
942     ASCII2XML_CHARS.put("\"", "&quot;");
943     ASCII2XML_CHARS.put(">", "&gt;");
944
945
946     UNICODE_CHARS.put("\u00C0", "A");
947     UNICODE_CHARS.put("\u00C1", "A");
948     UNICODE_CHARS.put("\u00C2", "A");
949     UNICODE_CHARS.put("\u00C3", "A");
950     UNICODE_CHARS.put("\u00C4", "A");
951     UNICODE_CHARS.put("\u00C5", "Aa");
952     UNICODE_CHARS.put("\u00C6", "Ae");
953     UNICODE_CHARS.put("\u00C7", "C");
954     UNICODE_CHARS.put("\u00C8", "E");
955     UNICODE_CHARS.put("\u00C9", "E");
956     UNICODE_CHARS.put("\u00CA", "E");
957     UNICODE_CHARS.put("\u00CB", "E");
958     UNICODE_CHARS.put("\u00CC", "I");
959     UNICODE_CHARS.put("\u00CD", "I");
960     UNICODE_CHARS.put("\u00CE", "I");
961     UNICODE_CHARS.put("\u00CF", "I");
962     UNICODE_CHARS.put("\u00D0", "D");
963     UNICODE_CHARS.put("\u00D1", "N");
964     UNICODE_CHARS.put("\u00D2", "O");
965     UNICODE_CHARS.put("\u00D3", "O");
966     UNICODE_CHARS.put("\u00D4", "O");
967     UNICODE_CHARS.put("\u00D5", "O");
968     UNICODE_CHARS.put("\u00D6", "Oe");
969     UNICODE_CHARS.put("\u00D8", "Oe");
970     UNICODE_CHARS.put("\u00D9", "U");
971     UNICODE_CHARS.put("\u00DA", "U");
972     UNICODE_CHARS.put("\u00DB", "U");
973     UNICODE_CHARS.put("\u00DC", "Ue"); // U umlaut ..
974     UNICODE_CHARS.put("\u00DD", "Y");
975     UNICODE_CHARS.put("\u00DF", "ss");
976     UNICODE_CHARS.put("\u00E0", "a");
977     UNICODE_CHARS.put("\u00E1", "a");
978     UNICODE_CHARS.put("\u00E2", "a");
979     UNICODE_CHARS.put("\u00E3", "a");
980     UNICODE_CHARS.put("\u00E4", "ae");
981     UNICODE_CHARS.put("\u00E5", "aa");
982     UNICODE_CHARS.put("\u00E6", "ae");
983     UNICODE_CHARS.put("\u00E7", "c");
984     UNICODE_CHARS.put("\u00E8", "e");
985     UNICODE_CHARS.put("\u00E9", "e");
986     UNICODE_CHARS.put("\u00EA", "e");
987     UNICODE_CHARS.put("\u00EB", "e");
988     UNICODE_CHARS.put("\u00EC", "i");
989     UNICODE_CHARS.put("\u00ED", "i");
990     UNICODE_CHARS.put("\u00EE", "i");
991     UNICODE_CHARS.put("\u00EF", "i");
992     UNICODE_CHARS.put("\u00F0", "o");
993     UNICODE_CHARS.put("\u00F1", "n");
994     UNICODE_CHARS.put("\u00F2", "o");
995     UNICODE_CHARS.put("\u00F3", "o");
996     UNICODE_CHARS.put("\u00F4", "o");
997     UNICODE_CHARS.put("\u00F5", "o");
998     UNICODE_CHARS.put("\u00F6", "oe");
999     UNICODE_CHARS.put("\u00F8", "oe");
1000     UNICODE_CHARS.put("\u00F9", "u");
1001     UNICODE_CHARS.put("\u00FA", "u");
1002     UNICODE_CHARS.put("\u00FB", "u");
1003     UNICODE_CHARS.put("\u00FC", "ue"); // u umlaut...
1004     UNICODE_CHARS.put("\u00FD", "y");
1005     UNICODE_CHARS.put("\u00FF", "y");
1006     UNICODE_CHARS.put("\u0100", "A");
1007     UNICODE_CHARS.put("\u0101", "a");
1008     UNICODE_CHARS.put("\u0102", "A");
1009     UNICODE_CHARS.put("\u0103", "a");
1010     UNICODE_CHARS.put("\u0104", "A");
1011     UNICODE_CHARS.put("\u0105", "a");
1012     UNICODE_CHARS.put("\u0106", "C");
1013     UNICODE_CHARS.put("\u0107", "c");
1014     UNICODE_CHARS.put("\u0108", "C");
1015     UNICODE_CHARS.put("\u0109", "c");
1016     UNICODE_CHARS.put("\u010A", "C");
1017     UNICODE_CHARS.put("\u010B", "c");
1018     UNICODE_CHARS.put("\u010C", "C");
1019     UNICODE_CHARS.put("\u010D", "c");
1020     UNICODE_CHARS.put("\u010E", "D");
1021     UNICODE_CHARS.put("\u010F", "d");
1022     UNICODE_CHARS.put("\u0110", "D");
1023     UNICODE_CHARS.put("\u0111", "d");
1024     UNICODE_CHARS.put("\u0112", "E");
1025     UNICODE_CHARS.put("\u0113", "e");
1026     UNICODE_CHARS.put("\u0114", "E");
1027     UNICODE_CHARS.put("\u0115", "e");
1028     UNICODE_CHARS.put("\u0116", "E");
1029     UNICODE_CHARS.put("\u0117", "e");
1030     UNICODE_CHARS.put("\u0118", "E");
1031     UNICODE_CHARS.put("\u0119", "e");
1032     UNICODE_CHARS.put("\u011A", "E");
1033     UNICODE_CHARS.put("\u011B", "e");
1034     UNICODE_CHARS.put("\u011C", "G");
1035     UNICODE_CHARS.put("\u011D", "g");
1036     UNICODE_CHARS.put("\u011E", "G");
1037     UNICODE_CHARS.put("\u011F", "g");
1038     UNICODE_CHARS.put("\u0120", "G");
1039     UNICODE_CHARS.put("\u0121", "g");
1040     UNICODE_CHARS.put("\u0122", "G");
1041     UNICODE_CHARS.put("\u0123", "g");
1042     UNICODE_CHARS.put("\u0124", "H");
1043     UNICODE_CHARS.put("\u0125", "h");
1044     UNICODE_CHARS.put("\u0127", "h");
1045     UNICODE_CHARS.put("\u0128", "I");
1046     UNICODE_CHARS.put("\u0129", "i");
1047     UNICODE_CHARS.put("\u012A", "I");
1048     UNICODE_CHARS.put("\u012B", "i");
1049     UNICODE_CHARS.put("\u012C", "I");
1050     UNICODE_CHARS.put("\u012D", "i");
1051     //UNICODE_CHARS.put("\u0100", "");
1052
1053     RTFCHARS.put("`a", "\\'e0");
1054     RTFCHARS.put("`e", "\\'e8");
1055     RTFCHARS.put("`i", "\\'ec");
1056     RTFCHARS.put("`o", "\\'f2");
1057     RTFCHARS.put("`u", "\\'f9");
1058     RTFCHARS.put("?a", "\\'e1");
1059     RTFCHARS.put("?e", "\\'e9");
1060     RTFCHARS.put("?i", "\\'ed");
1061     RTFCHARS.put("?o", "\\'f3");
1062     RTFCHARS.put("?u", "\\'fa");
1063     RTFCHARS.put("^a", "\\'e2");
1064     RTFCHARS.put("^e", "\\'ea");
1065     RTFCHARS.put("^i", "\\'ee");
1066     RTFCHARS.put("^o", "\\'f4");
1067     RTFCHARS.put("^u", "\\'fa");
1068     RTFCHARS.put("\"a", "\\'e4");
1069     RTFCHARS.put("\"e", "\\'eb");
1070     RTFCHARS.put("\"i", "\\'ef");
1071     RTFCHARS.put("\"o", "\\'f6");
1072     RTFCHARS.put("\"u", "\\uc0\\u252");
1073     RTFCHARS.put("~n", "\\'f1");
1074     RTFCHARS.put("`A", "\\'c0");
1075     RTFCHARS.put("`E", "\\'c8");
1076     RTFCHARS.put("`I", "\\'cc");
1077     RTFCHARS.put("`O", "\\'d2");
1078     RTFCHARS.put("`U", "\\'d9");
1079     RTFCHARS.put("?A", "\\'c1");
1080     RTFCHARS.put("?E", "\\'c9");
1081     RTFCHARS.put("?I", "\\'cd");
1082     RTFCHARS.put("?O", "\\'d3");
1083     RTFCHARS.put("?U", "\\'da");
1084     RTFCHARS.put("^A", "\\'c2");
1085     RTFCHARS.put("^E", "\\'ca");
1086     RTFCHARS.put("^I", "\\'ce");
1087     RTFCHARS.put("^O", "\\'d4");
1088     RTFCHARS.put("^U", "\\'db");
1089     RTFCHARS.put("\"A", "\\'c4");
1090     RTFCHARS.put("\"E", "\\'cb");
1091     RTFCHARS.put("\"I", "\\'cf");
1092     RTFCHARS.put("\"O", "\\'d6");
1093     RTFCHARS.put("\"U", "\\'dc");
1094     // Use UNICODE characters for RTF-Chars which can not be found in the standard codepage
1095
1096     //  RTFCHARS.put("`A", "\\uc0\\u192");     // "Agrave" exists in standard codepage  
1097       RTFCHARS.put("'A", "\\uc0\\u193");     // "Aacute"
1098 //  RTFCHARS.put("^A", "\\uc0\\u194");     // "Acirc"  exists in standard codepage
1099       RTFCHARS.put("~A", "\\uc0\\u195");     // "Atilde"
1100 //  RTFCHARS.put("\"A", "\\uc0\\u196");    // "Auml"   exists in standard codepage
1101       RTFCHARS.put("AA", "\\uc0\\u197");     // "Aring"
1102       RTFCHARS.put("AE", "\\uc0\\u198");     // "AElig"
1103       RTFCHARS.put("cC", "\\uc0\\u199");     // "Ccedil"
1104 //  RTFCHARS.put("`E", "\\uc0\\u200");     // "Egrave" exists in standard codepage
1105       RTFCHARS.put("'E", "\\uc0\\u201");     // "Eacute"
1106 //  RTFCHARS.put("^E", "\\uc0\\u202");     // "Ecirc"  exists in standard codepage
1107 //  RTFCHARS.put("\"E", "\\uc0\\u203");    // "Euml"   exists in standard codepage
1108 //  RTFCHARS.put("`I", "\\uc0\\u204");     // "Igrave" exists in standard codepage
1109       RTFCHARS.put("'I", "\\uc0\\u205");     // "Iacute"
1110 //  RTFCHARS.put("^I", "\\uc0\\u206");     // "Icirc"  exists in standard codepage
1111 //  RTFCHARS.put("\"I", "\\uc0\\u207");    // "Iuml"   exists in standard codepage
1112       RTFCHARS.put("DH", "\\uc0\\u208");     // "ETH"
1113       RTFCHARS.put("~N", "\\uc0\\u209");     // "Ntilde"
1114 //  RTFCHARS.put("`O", "\\uc0\\u210");     // "Ograve" exists in standard codepage
1115       RTFCHARS.put("'O", "\\uc0\\u211");     // "Oacute"
1116 //  RTFCHARS.put("^O", "\\uc0\\u212");     // "Ocirc"  exists in standard codepage
1117       RTFCHARS.put("~O", "\\uc0\\u213");     // "Otilde"
1118 //  RTFCHARS.put("\"O", "\\uc0\\u214");    // "Ouml"   exists in standard codepage
1119       // According to ISO 8859-1 the "\times" symbol should be placed here (#215).
1120       // Omitting this, because it is a mathematical symbol.
1121       RTFCHARS.put("O", "\\uc0\\u216");      // "OSlash"
1122 //  RTFCHARS.put("`U", "\\uc0\\u217");     // "Ugrave"  exists in standard codepage
1123       RTFCHARS.put("'U", "\\uc0\\u218");     // "Uacute"
1124 //  RTFCHARS.put("^U", "\\uc0\\u219");     // "Ucirc"   exists in standard codepage
1125 //  RTFCHARS.put("\"U", "\\uc0\\u220");    // "Uuml"    exists in standard codepage
1126       RTFCHARS.put("'Y", "\\uc0\\u221");     // "Yacute"
1127       RTFCHARS.put("TH", "\\uc0\\u222");     // "THORN"
1128       RTFCHARS.put("ss", "\\uc0\\u223");     // "szlig"
1129 //  RTFCHARS.put("`a", "\\uc0\\u224");     // "agrave"  exists in standard codepage
1130       RTFCHARS.put("'a", "\\uc0\\u225");     // "aacute"
1131 //  RTFCHARS.put("^a", "\\uc0\\u226");     // "acirc"   exists in standard codepage
1132       RTFCHARS.put("~a", "\\uc0\\u227");     // "atilde"
1133 //  RTFCHARS.put("\"a", "\\uc0\\u228");    // "auml"    exists in standard codepage
1134       RTFCHARS.put("aa", "\\uc0\\u229");     // "aring"
1135       RTFCHARS.put("ae", "\\uc0\\u230");     // "aelig"
1136       RTFCHARS.put("cc", "\\uc0\\u231");     // "ccedil"
1137 //  RTFCHARS.put("`e", "\\uc0\\u232");     // "egrave"  exists in standard codepage
1138       RTFCHARS.put("'e", "\\uc0\\u233");     // "eacute"
1139 //  RTFCHARS.put("^e", "\\uc0\\u234");     // "ecirc"   exists in standard codepage
1140 //  RTFCHARS.put("\"e", "\\uc0\\u235");    // "euml"    exists in standard codepage
1141 //  RTFCHARS.put("`i", "\\uc0\\u236");     // "igrave"  exists in standard codepage
1142       RTFCHARS.put("'i", "\\uc0\\u237");     // "iacute"
1143 //  RTFCHARS.put("^i", "\\uc0\\u238");     // "icirc"   exists in standard codepage
1144 //  RTFCHARS.put("\"i", "\\uc0\\u239");    // "iuml"    exists in standard codepage
1145       RTFCHARS.put("dh", "\\uc0\\u240");     // "eth"
1146 //  RTFCHARS.put("~n", "\\uc0\\u241");     // "ntilde"  exists in standard codepage
1147 //  RTFCHARS.put("`o", "\\uc0\\u242");     // "ograve"  exists in standard codepage
1148       RTFCHARS.put("'o", "\\uc0\\u243");     // "oacute"
1149 //  RTFCHARS.put("^o", "\\uc0\\u244");     // "ocirc"   exists in standard codepage
1150       RTFCHARS.put("~o", "\\uc0\\u245");     // "otilde"
1151 //  RTFCHARS.put("\"o", "\\uc0\\u246");    // "ouml"    exists in standard codepage
1152       // According to ISO 8859-1 the "\div" symbol should be placed here (#247).
1153       // Omitting this, because it is a mathematical symbol.
1154       RTFCHARS.put("o", "\\uc0\\u248");       // "oslash"
1155 //  RTFCHARS.put("`u", "\\uc0\\u249");      // "ugrave"  exists in standard codepage
1156       RTFCHARS.put("'u", "\\uc0\\u250");      // "uacute"
1157 //  RTFCHARS.put("^u", "\\uc0\\u251");      // "ucirc"   exists in standard codepage
1158 //  RTFCHARS.put("\"u", "\\uc0\\u252");     // "uuml"    exists in standard codepage
1159       RTFCHARS.put("'y", "\\uc0\\u253");      // "yacute"
1160       RTFCHARS.put("th", "\\uc0\\u254");      // "thorn"
1161       RTFCHARS.put("\"y", "\\uc0\\u255");     // "yuml"
1162
1163       RTFCHARS.put("=A", "\\uc0\\u256");      // "Amacr"
1164       RTFCHARS.put("=a", "\\uc0\\u257");      // "amacr"
1165       RTFCHARS.put("uA", "\\uc0\\u258");      // "Abreve"
1166       RTFCHARS.put("ua", "\\uc0\\u259");      // "abreve"
1167       RTFCHARS.put("kA", "\\uc0\\u260");      // "Aogon"
1168       RTFCHARS.put("ka", "\\uc0\\u261");      // "aogon"
1169       RTFCHARS.put("'C", "\\uc0\\u262");      // "Cacute"
1170       RTFCHARS.put("'c", "\\uc0\\u263");      // "cacute"
1171       RTFCHARS.put("^C", "\\uc0\\u264");      // "Ccirc"
1172       RTFCHARS.put("^c", "\\uc0\\u265");      // "ccirc"
1173       RTFCHARS.put(".C", "\\uc0\\u266");      // "Cdot"
1174       RTFCHARS.put(".c", "\\uc0\\u267");      // "cdot"
1175       RTFCHARS.put("vC", "\\uc0\\u268");      // "Ccaron"
1176       RTFCHARS.put("vc", "\\uc0\\u269");      // "ccaron"
1177       RTFCHARS.put("vD", "\\uc0\\u270");      // "Dcaron"
1178       // Symbol #271 (d´) has no special Latex command
1179       RTFCHARS.put("DJ", "\\uc0\\u272");      // "Dstrok"
1180       RTFCHARS.put("dj", "\\uc0\\u273");      // "dstrok"
1181       RTFCHARS.put("=E", "\\uc0\\u274");      // "Emacr"
1182       RTFCHARS.put("=e", "\\uc0\\u275");      // "emacr"
1183       RTFCHARS.put("uE", "\\uc0\\u276");      // "Ebreve"
1184       RTFCHARS.put("ue", "\\uc0\\u277");      // "ebreve"
1185       RTFCHARS.put(".E", "\\uc0\\u278");      // "Edot"
1186       RTFCHARS.put(".e", "\\uc0\\u279");      // "edot"
1187       RTFCHARS.put("kE", "\\uc0\\u280");      // "Eogon"
1188       RTFCHARS.put("ke", "\\uc0\\u281");      // "eogon"
1189       RTFCHARS.put("vE", "\\uc0\\u282");      // "Ecaron"
1190       RTFCHARS.put("ve", "\\uc0\\u283");      // "ecaron"
1191       RTFCHARS.put("^G", "\\uc0\\u284");      // "Gcirc"
1192       RTFCHARS.put("^g", "\\uc0\\u285");      // "gcirc"
1193       RTFCHARS.put("uG", "\\uc0\\u286");      // "Gbreve"
1194       RTFCHARS.put("ug", "\\uc0\\u287");      // "gbreve"
1195       RTFCHARS.put(".G", "\\uc0\\u288");      // "Gdot"
1196       RTFCHARS.put(".g", "\\uc0\\u289");      // "gdot"
1197       RTFCHARS.put("cG", "\\uc0\\u290");      // "Gcedil"
1198       RTFCHARS.put("'g", "\\uc0\\u291");      // "gacute"
1199       RTFCHARS.put("^H", "\\uc0\\u292");      // "Hcirc"
1200       RTFCHARS.put("^h", "\\uc0\\u293");      // "hcirc"
1201       RTFCHARS.put("Hstrok", "\\uc0\\u294");  // "Hstrok"
1202       RTFCHARS.put("hstrok", "\\uc0\\u295");  // "hstrok"
1203       RTFCHARS.put("~I", "\\uc0\\u296");      // "Itilde"
1204       RTFCHARS.put("~i", "\\uc0\\u297");      // "itilde"
1205       RTFCHARS.put("=I", "\\uc0\\u298");      // "Imacr"
1206       RTFCHARS.put("=i", "\\uc0\\u299");      // "imacr"
1207       RTFCHARS.put("uI", "\\uc0\\u300");      // "Ibreve"
1208       RTFCHARS.put("ui", "\\uc0\\u301");      // "ibreve"
1209       RTFCHARS.put("kI", "\\uc0\\u302");      // "Iogon"
1210       RTFCHARS.put("ki", "\\uc0\\u303");      // "iogon"
1211       RTFCHARS.put(".I", "\\uc0\\u304");      // "Idot"
1212       RTFCHARS.put("i", "\\uc0\\u305");       // "inodot"
1213       // Symbol #306 (IJ) has no special Latex command
1214       // Symbol #307 (ij) has no special Latex command
1215       RTFCHARS.put("^J", "\\uc0\\u308");      // "Jcirc"
1216       RTFCHARS.put("^j", "\\uc0\\u309");      // "jcirc"
1217       RTFCHARS.put("cK", "\\uc0\\u310");      // "Kcedil"
1218       RTFCHARS.put("ck", "\\uc0\\u311");      // "kcedil"
1219       // Symbol #312 (k) has no special Latex command
1220       RTFCHARS.put("'L", "\\uc0\\u313");      // "Lacute"
1221       RTFCHARS.put("'l", "\\uc0\\u314");      // "lacute"
1222       RTFCHARS.put("cL", "\\uc0\\u315");      // "Lcedil"
1223       RTFCHARS.put("cl", "\\uc0\\u316");      // "lcedil"
1224       // Symbol #317 (L´) has no special Latex command
1225       // Symbol #318 (l´) has no special Latex command
1226       RTFCHARS.put("Lmidot", "\\uc0\\u319");  // "Lmidot"
1227       RTFCHARS.put("lmidot", "\\uc0\\u320");  // "lmidot"
1228       RTFCHARS.put("L", "\\uc0\\u321");      // "Lstrok"
1229       RTFCHARS.put("l", "\\uc0\\u322");      // "lstrok"
1230       RTFCHARS.put("'N", "\\uc0\\u323");      // "Nacute"
1231       RTFCHARS.put("'n", "\\uc0\\u324");      // "nacute"
1232       RTFCHARS.put("cN", "\\uc0\\u325");      // "Ncedil"
1233       RTFCHARS.put("cn", "\\uc0\\u326");      // "ncedil"
1234       RTFCHARS.put("vN", "\\uc0\\u327");      // "Ncaron"
1235       RTFCHARS.put("vn", "\\uc0\\u328");      // "ncaron"
1236       // Symbol #329 (´n) has no special Latex command
1237       RTFCHARS.put("NG", "\\uc0\\u330");      // "ENG"
1238       RTFCHARS.put("ng", "\\uc0\\u331");      // "eng"
1239       RTFCHARS.put("=O", "\\uc0\\u332");      // "Omacr"
1240       RTFCHARS.put("=o", "\\uc0\\u333");      // "omacr"
1241       RTFCHARS.put("uO", "\\uc0\\u334");      // "Obreve"
1242       RTFCHARS.put("uo", "\\uc0\\u335");      // "obreve"
1243       RTFCHARS.put("HO", "\\uc0\\u336");      // "Odblac"
1244       RTFCHARS.put("Ho", "\\uc0\\u337");      // "odblac"
1245       RTFCHARS.put("OE", "\\uc0\\u338");      // "OElig"
1246       RTFCHARS.put("oe", "\\uc0\\u339");      // "oelig"
1247       RTFCHARS.put("'R", "\\uc0\\u340");      // "Racute"
1248       RTFCHARS.put("'r", "\\uc0\\u341");      // "racute"
1249       RTFCHARS.put("cR", "\\uc0\\u342");      // "Rcedil"
1250       RTFCHARS.put("cr", "\\uc0\\u343");      // "rcedil"
1251       RTFCHARS.put("vR", "\\uc0\\u344");      // "Rcaron"
1252       RTFCHARS.put("vr", "\\uc0\\u345");      // "rcaron"
1253       RTFCHARS.put("'S", "\\uc0\\u346");      // "Sacute"
1254       RTFCHARS.put("'s", "\\uc0\\u347");      // "sacute"
1255       RTFCHARS.put("^S", "\\uc0\\u348");      // "Scirc"
1256       RTFCHARS.put("^s", "\\uc0\\u349");      // "scirc"
1257       RTFCHARS.put("cS", "\\uc0\\u350");      // "Scedil"
1258       RTFCHARS.put("cs", "\\uc0\\u351");      // "scedil"
1259       RTFCHARS.put("vS", "\\uc0\\u352");      // "Scaron"
1260       RTFCHARS.put("vs", "\\uc0\\u353");      // "scaron"
1261       RTFCHARS.put("cT", "\\uc0\\u354");      // "Tcedil"
1262       RTFCHARS.put("ct", "\\uc0\\u355");      // "tcedil"
1263       RTFCHARS.put("vT", "\\uc0\\u356");      // "Tcaron"
1264       // Symbol #357 (t´) has no special Latex command
1265       RTFCHARS.put("Tstrok", "\\uc0\\u358");  // "Tstrok"
1266       RTFCHARS.put("tstrok", "\\uc0\\u359");  // "tstrok"
1267       RTFCHARS.put("~U", "\\uc0\\u360");      // "Utilde"
1268       RTFCHARS.put("~u", "\\uc0\\u361");      // "utilde"
1269       RTFCHARS.put("=U", "\\uc0\\u362");      // "Umacr"
1270       RTFCHARS.put("=u", "\\uc0\\u363");      // "umacr"
1271       RTFCHARS.put("uU", "\\uc0\\u364");      // "Ubreve"
1272       RTFCHARS.put("uu", "\\uc0\\u365");      // "ubreve"
1273       RTFCHARS.put("rU", "\\uc0\\u366");      // "Uring"
1274       RTFCHARS.put("ru", "\\uc0\\u367");      // "uring"
1275       RTFCHARS.put("HU", "\\uc0\\u368");      // "Odblac"
1276       RTFCHARS.put("Hu", "\\uc0\\u369");      // "odblac"
1277       RTFCHARS.put("kU", "\\uc0\\u370");      // "Uogon"
1278       RTFCHARS.put("ku", "\\uc0\\u371");      // "uogon"
1279       RTFCHARS.put("^W", "\\uc0\\u372");      // "Wcirc"
1280       RTFCHARS.put("^w", "\\uc0\\u373");      // "wcirc"
1281       RTFCHARS.put("^Y", "\\uc0\\u374");      // "Ycirc"
1282       RTFCHARS.put("^y", "\\uc0\\u375");      // "ycirc"
1283       RTFCHARS.put("\"Y", "\\uc0\\u376");     // "Yuml"
1284       RTFCHARS.put("'Z", "\\uc0\\u377");      // "Zacute"
1285       RTFCHARS.put("'z", "\\uc0\\u378");      // "zacute"
1286       RTFCHARS.put(".Z", "\\uc0\\u379");      // "Zdot"
1287       RTFCHARS.put(".z", "\\uc0\\u380");      // "zdot"
1288       RTFCHARS.put("vZ", "\\uc0\\u381");      // "Zcaron"
1289       RTFCHARS.put("vz", "\\uc0\\u382");      // "zcaron"
1290       // Symbol #383 (f) has no special Latex command
1291
1292     //XML_CHARS.put("\\u00E1", "&#x00E1;");
1293   }
1294
1295     public static void initializeJournalNames() {
1296         journalAbbrev = new JournalAbbreviations();//"/resource/journalList.txt");
1297
1298         // Read external lists, if any (in reverse order, so the upper lists override the lower):
1299         String[] lists = prefs.getStringArray("externalJournalLists");
1300         if ((lists != null) && (lists.length > 0)) {
1301             for (int i=lists.length-1; i>=0; i--) {
1302                 try {
1303                     journalAbbrev.readJournalList(new File(lists[i]));
1304                 } catch (FileNotFoundException e) {
1305                     // The file couldn't be found... should we tell anyone?
1306                     Globals.logger(e.getMessage());
1307                 }
1308             }
1309         }
1310
1311         // Read personal list, if set up:
1312         if (prefs.get("personalJournalList") != null) {
1313             try {
1314                 journalAbbrev.readJournalList(new File(prefs.get("personalJournalList")));
1315             } catch (FileNotFoundException e) {
1316                 Globals.logger("Personal journal list file '"+prefs.get("personalJournalList")+
1317                     "' not found.");
1318             }
1319         }
1320
1321
1322     }
1323
1324 }