6038b507e90d4a2d4d078be0051c8d5c06a44b22
[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,// =
46                 // Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
47                 FUTURE_YEAR = 2050, // Needs to give a year definitely in the future.
48                 // Used for guessing the
49                 // year field when parsing textual data. :-)
50
51                 STANDARD_EXPORT_COUNT = 5, // The number of standard export formats.
52                 METADATA_LINE_LENGTH = 70; // The line length used to wrap metadata.
53
54         private static String resourcePrefix = "resource/JabRef", menuResourcePrefix = "resource/Menu",
55                 integrityResourcePrefix = "resource/IntegrityMessage";
56
57         private static final String buildInfos = "/resource/build.properties";
58
59         /*
60          * some extra field definitions
61          */
62         public static final String additionalFields = "/resource/fields/fields.xml";
63
64         public static ResourceBundle messages, menuTitles, intMessages;
65
66         public static FileUpdateMonitor fileUpdateMonitor = new FileUpdateMonitor();
67
68         public static ImportFormatReader importFormatReader = new ImportFormatReader();
69
70         public static ErrorConsole errorConsole;
71
72         public static String VERSION, BUILD, BUILD_DATE;
73
74         static {
75                 TBuildInfo bi = new TBuildInfo(buildInfos);
76                 VERSION = bi.getBUILD_VERSION();
77                 BUILD = bi.getBUILD_NUMBER();
78                 BUILD_DATE = bi.getBUILD_DATE();
79
80                 // TODO: Error console initialization here. When should it be used?
81                 errorConsole = ErrorConsole.getInstance();
82         }
83
84         // public static ResourceBundle preferences =
85         // ResourceBundle.getBundle("resource/defaultPrefs");
86         public static Locale locale;
87
88         public static final String FILETYPE_PREFS_EXT = "_dir", SELECTOR_META_PREFIX = "selector_",
89                 LAYOUT_PREFIX = "/resource/layout/", MAC = "Mac OS X",
90                 DOI_LOOKUP_PREFIX = "http://dx.doi.org/", NONE = "_non__",
91                 FORMATTER_PACKAGE = "net.sf.jabref.export.layout.format.";
92
93         public static float duplicateThreshold = 0.75f;
94
95         private static Handler consoleHandler = new java.util.logging.ConsoleHandler();
96
97         public static String[] ENCODINGS, ALL_ENCODINGS = // (String[])
98                 // Charset.availableCharsets().keySet().toArray(new
99                 // String[]{});
100                 new String[] { "ISO8859_1", "UTF8", "UTF-16", "ASCII", "Cp1250", "Cp1251", "Cp1252",
101                         "Cp1253", "Cp1254", "Cp1257", "JIS", "SJIS",
102                         "EUC_JP", // Added Japanese encodings.
103                         "Big5", "Big5_HKSCS", "GBK", "ISO8859_2", "ISO8859_3", "ISO8859_4", "ISO8859_5",
104                         "ISO8859_6", "ISO8859_7", "ISO8859_8", "ISO8859_9", "ISO8859_13", "ISO8859_15" };
105
106         // String array that maps from month number to month string label:
107         public static String[] MONTHS = new String[] { "jan", "feb", "mar", "apr", "may", "jun", "jul",
108                 "aug", "sep", "oct", "nov", "dec" };
109
110         // Map that maps from month string labels to
111         public static Map<String, String> MONTH_STRINGS = new HashMap<String, String>();
112         static {
113                 MONTH_STRINGS.put("jan", "January");
114                 MONTH_STRINGS.put("feb", "February");
115                 MONTH_STRINGS.put("mar", "March");
116                 MONTH_STRINGS.put("apr", "April");
117                 MONTH_STRINGS.put("may", "May");
118                 MONTH_STRINGS.put("jun", "June");
119                 MONTH_STRINGS.put("jul", "July");
120                 MONTH_STRINGS.put("aug", "August");
121                 MONTH_STRINGS.put("sep", "September");
122                 MONTH_STRINGS.put("oct", "October");
123                 MONTH_STRINGS.put("nov", "November");
124                 MONTH_STRINGS.put("dec", "December");
125
126                 // Build list of encodings, by filtering out all that are not supported
127                 // on this system:
128                 List<String> encodings = new ArrayList<String>();
129                 for (int i = 0; i < ALL_ENCODINGS.length; i++) {
130                         if (Charset.isSupported(ALL_ENCODINGS[i])) {
131                                 encodings.add(ALL_ENCODINGS[i]);
132                         }
133                 }
134                 ENCODINGS = encodings.toArray(new String[0]);
135
136         }
137
138         public static GlobalFocusListener focusListener = new GlobalFocusListener();
139
140         public static JabRefPreferences prefs = null;
141
142         public static HelpDialog helpDiag = null;
143
144         public static String osName = System.getProperty("os.name", "def");
145
146         public static boolean ON_MAC = (osName.equals(MAC)), ON_WIN = osName.startsWith("Windows");
147
148         public static String[] SKIP_WORDS = { "a", "an", "the", "for", "on" };
149
150         public static SidePaneManager sidePaneManager;
151
152         public static final String NEWLINE = System.getProperty("line.separator");
153     public static final int NEWLINE_LENGTH = System.getProperty("line.separator").length();
154
155     // Instantiate logger:
156     private static Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
157
158     /**
159          * true if we have unix newlines
160          */
161         public static final boolean UNIX_NEWLINE = NEWLINE.equals("\n");
162
163         public static final String BIBTEX_STRING = "__string";
164
165         // "Fieldname" to indicate that a field should be treated as a bibtex
166         // string. Used when writing database to file.
167
168         public static void logger(String s) {
169                 logger.info(s);
170         }
171
172         public static void turnOffLogging() { // only log exceptions
173                 logger.setLevel(java.util.logging.Level.SEVERE);
174         }
175
176         // should be only called once
177         public static void turnOnConsoleLogging() {
178                 logger.addHandler(consoleHandler);
179
180         }
181
182         public static void turnOnFileLogging() {
183                 logger.setLevel(java.util.logging.Level.ALL);
184                 java.util.logging.Handler handler;
185                 handler = new ConsoleHandler();
186                 /*
187                  * try { handler = new FileHandler(logfile); // this will overwrite }
188                  * catch (IOException e) { //can't open log file so use console
189                  * e.printStackTrace(); }
190                  */
191                 logger.addHandler(handler);
192
193                 handler.setFilter(new Filter() { // select what gets logged
194                                 public boolean isLoggable(LogRecord record) {
195                                         return true;
196                                 }
197                         });
198         }
199
200         public static void setLanguage(String language, String country) {
201                 locale = new Locale(language, country);
202                 messages = ResourceBundle.getBundle(resourcePrefix, locale);
203                 menuTitles = ResourceBundle.getBundle(menuResourcePrefix, locale);
204                 intMessages = ResourceBundle.getBundle(integrityResourcePrefix, locale);
205                 Locale.setDefault(locale);
206                 javax.swing.JComponent.setDefaultLocale(locale);
207         }
208
209         public static JournalAbbreviations journalAbbrev;
210
211         public static String lang(String key, String[] params) {
212                 String translation = null;
213                 try {
214                         if (Globals.messages != null) 
215                                 translation = Globals.messages.getString(key.replaceAll(" ", "_"));
216                 } catch (MissingResourceException ex) {
217                         //logger("Warning: could not get translation for \"" + key + "\"");
218                 }
219                 if (translation == null)
220                         translation = key;
221
222                 if ((translation != null) && (translation.length() != 0)) {
223                         translation = translation.replaceAll("_", " ");
224                         StringBuffer sb = new StringBuffer();
225                         boolean b = false;
226                         char c;
227                         for (int i = 0; i < translation.length(); ++i) {
228                                 c = translation.charAt(i);
229                                 if (c == '%') {
230                                         b = true;
231                                 } else {
232                                         if (!b) {
233                                                 sb.append(c);
234                                         } else {
235                                                 b = false;
236                                                 try {
237                                                         int index = Integer.parseInt(String.valueOf(c));
238                                                         if (params != null && index >= 0 && index <= params.length)
239                                                                 sb.append(params[index]);
240                                                 } catch (NumberFormatException e) {
241                                                         // append literally (for quoting) or insert special
242                                                         // symbol
243                                                         switch (c) {
244                                                         case 'c': // colon
245                                                                 sb.append(':');
246                                                                 break;
247                                                         case 'e': // equal
248                                                                 sb.append('=');
249                                                                 break;
250                                                         default: // anything else, e.g. %
251                                                                 sb.append(c);
252                                                         }
253                                                 }
254                                         }
255                                 }
256                         }
257                         return sb.toString();
258                 }
259                 return key;
260         }
261
262         public static String lang(String key) {
263                 return lang(key, (String[]) null);
264         }
265
266         public static String lang(String key, String s1) {
267                 return lang(key, new String[] { s1 });
268         }
269
270         public static String lang(String key, String s1, String s2) {
271                 return lang(key, new String[] { s1, s2 });
272         }
273
274         public static String lang(String key, String s1, String s2, String s3) {
275                 return lang(key, new String[] { s1, s2, s3 });
276         }
277
278         public static String menuTitle(String key) {
279                 String translation = null;
280                 try {
281                         if (Globals.messages != null) {
282                                 translation = Globals.menuTitles.getString(key.replaceAll(" ", "_"));
283                         }
284                 } catch (MissingResourceException ex) {
285                         translation = key;
286
287                         //System.err.println("Warning: could not get menu item translation for \""
288                         //+ key + "\"");
289
290                 }
291                 if ((translation != null) && (translation.length() != 0)) {
292                         return translation.replaceAll("_", " ");
293                 } else {
294                         return key;
295                 }
296         }
297
298         public static String getIntegrityMessage(String key) {
299                 String translation = null;
300                 try {
301                         if (Globals.intMessages != null) {
302                                 translation = Globals.intMessages.getString(key);
303                         }
304                 } catch (MissingResourceException ex) {
305                         translation = key;
306
307                         // System.err.println("Warning: could not get menu item translation
308                         // for \""
309                         // + key + "\"");
310                 }
311                 if ((translation != null) && (translation.length() != 0)) {
312                         return translation;
313                 } else {
314                         return key;
315                 }
316         }
317
318         // ============================================================
319         // Using the hashmap of entry types found in BibtexEntryType
320         // ============================================================
321         public static BibtexEntryType getEntryType(String type) {
322                 // decide which entryType object to return
323                 Object o = BibtexEntryType.ALL_TYPES.get(type);
324                 if (o != null) {
325                         return (BibtexEntryType) o;
326                 } else {
327                         return BibtexEntryType.OTHER;
328                 }
329                 /*
330                  * if(type.equals("article")) return BibtexEntryType.ARTICLE; else
331                  * if(type.equals("book")) return BibtexEntryType.BOOK; else
332                  * if(type.equals("inproceedings")) return
333                  * BibtexEntryType.INPROCEEDINGS;
334                  */
335         }
336
337         /**
338          * This method provides the correct opening brace to use when writing a
339          * field to BibTeX format.
340          * 
341          * @return A String containing the braces to use.
342          */
343         public static String getOpeningBrace() {
344                 return "{";
345                 /*
346                  * As of version 2.0, storing all fields with double braces is no longer
347                  * supported, because it causes problems with e.g. the author field.
348                  * 
349                  * if (prefs.getBoolean("autoDoubleBraces")) return "{{"; else return
350                  * "{";
351                  */
352         }
353
354         /**
355          * This method provides the correct closing brace to use when writing a
356          * field to BibTeX format.
357          * 
358          * @return A String containing the braces to use.
359          */
360         public static String getClosingBrace() {
361                 return "}";
362                 /*
363                  * As of version 2.0, storing all fields with double braces is no longer
364                  * supported, because it causes problems with e.g. the author field.
365                  * 
366                  * if (prefs.getBoolean("autoDoubleBraces")) return "}}"; else
367                  */
368
369         }
370
371         /**
372          * Will return the names of multiple files selected in the given directory
373          * and the given extensions.
374          * 
375          * Will return an empty String array if no entry is found.
376          * 
377          * @param owner
378          * @param directory
379          * @param extension
380          * @param updateWorkingdirectory
381          * @return an array of selected file paths, or an empty array if no selection is made.
382          */
383         public static String[] getMultipleFiles(JFrame owner, File directory, String extension,
384                 boolean updateWorkingdirectory) {
385
386                 OpenFileFilter off = null;
387                 if (extension == null)
388                         off = new OpenFileFilter();
389                 else if (!extension.equals(NONE))
390                         off = new OpenFileFilter(extension);
391
392                 Object files = getNewFileImpl(owner, directory, extension, null, off,
393                         JFileChooser.OPEN_DIALOG, updateWorkingdirectory, false, true, null);
394
395                 if (files instanceof String[]) {
396                         return (String[]) files;
397                 }
398                 // Fix for:
399                 // http://sourceforge.net/tracker/index.php?func=detail&aid=1538769&group_id=92314&atid=600306
400                 if (files != null) {
401                         return new String[] { (String) files };
402                 }
403                 return new String[0];
404         }
405
406         public static String getNewFile(JFrame owner, File directory, String extension, int dialogType,
407                 boolean updateWorkingDirectory) {
408                 return getNewFile(owner, directory, extension, null, dialogType, updateWorkingDirectory,
409                         false, null);
410         }
411
412         public static String getNewFile(JFrame owner, File directory, String extension, int dialogType,
413                 boolean updateWorkingDirectory, JComponent accessory) {
414                 return getNewFile(owner, directory, extension, null, dialogType, updateWorkingDirectory,
415                         false, accessory);
416         }
417
418         
419         public static String getNewFile(JFrame owner, File directory, String extension,
420                 String description, int dialogType, boolean updateWorkingDirectory) {
421                 return getNewFile(owner, directory, extension, description, dialogType,
422                         updateWorkingDirectory, false, null);
423         }
424
425         public static String getNewDir(JFrame owner, File directory, String extension, int dialogType,
426                 boolean updateWorkingDirectory) {
427                 return getNewFile(owner, directory, extension, null, dialogType, updateWorkingDirectory,
428                         true, null);
429         }
430
431         public static String getNewDir(JFrame owner, File directory, String extension,
432                 String description, int dialogType, boolean updateWorkingDirectory) {
433                 return getNewFile(owner, directory, extension, description, dialogType,
434                         updateWorkingDirectory, true, null);
435         }
436
437         private static String getNewFile(JFrame owner, File directory, String extension,
438                 String description, int dialogType, boolean updateWorkingDirectory, boolean dirOnly,
439                 JComponent accessory) {
440
441                 OpenFileFilter off = null;
442
443                 if (extension == null)
444                         off = new OpenFileFilter();
445                 else if (!extension.equals(NONE))
446                         off = new OpenFileFilter(extension);
447
448                 return (String) getNewFileImpl(owner, directory, extension, description, off, dialogType,
449                         updateWorkingDirectory, dirOnly, false, accessory);
450         }
451
452         private static Object getNewFileImpl(JFrame owner, File directory, String extension,
453                 String description, OpenFileFilter off, int dialogType, boolean updateWorkingDirectory,
454                 boolean dirOnly, boolean multipleSelection, JComponent accessory) {
455
456                 if (/*ON_MAC && */prefs.getBoolean("useNativeFileDialogOnMac")) {
457
458                         return getNewFileForMac(owner, directory, extension, dialogType,
459                                 updateWorkingDirectory, dirOnly, off);
460                 }
461
462                 JFileChooser fc;
463                 try {
464                         fc = new JabRefFileChooser(directory);
465                         if (accessory != null)
466                             fc.setAccessory(accessory);
467                 } catch (InternalError errl) {
468                         // This try/catch clause was added because a user reported an
469                         // InternalError getting thrown on WinNT, presumably because of a
470                         // bug in JGoodies Windows PLAF. This clause can be removed if the
471                         // bug is fixed, but for now we just resort to the native file
472                         // dialog, using the same method as is always used on Mac:
473                         return getNewFileForMac(owner, directory, extension, dialogType,
474                                 updateWorkingDirectory, dirOnly, off);
475                 }
476
477                 if (dirOnly) {
478                         fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
479
480                 }
481
482                 fc.setMultiSelectionEnabled(multipleSelection);
483
484                 fc.addChoosableFileFilter(off);
485                 fc.setDialogType(dialogType);
486                 int dialogResult;
487                 if (dialogType == JFileChooser.OPEN_DIALOG) {
488                         dialogResult = fc.showOpenDialog(owner);
489                 } else if (dialogType == JFileChooser.SAVE_DIALOG) {
490                         dialogResult = fc.showSaveDialog(owner);
491                 } else {
492                         dialogResult = fc.showDialog(owner, description);
493                 }
494
495                 // the getSelectedFile method returns a valid fileselection
496                 // (if something is selected) indepentently from dialog return status
497                 if (dialogResult != JFileChooser.APPROVE_OPTION)
498                         return null;
499
500                 // okay button
501                 File selectedFile = fc.getSelectedFile();
502                 if (selectedFile == null) { // cancel
503                         return null;
504                 }
505
506                 // If this is a save dialog, and the user has not chosen "All files" as
507                 // filter
508                 // we enforce the given extension. But only if extension is not null.
509                 if ((extension != null) && (dialogType == JFileChooser.SAVE_DIALOG)
510                         && (fc.getFileFilter() == off) && !off.accept(selectedFile)) {
511
512                         // add the first extension if there are multiple extensions
513                         selectedFile = new File(selectedFile.getPath() + extension.split("[, ]+", 0)[0]);
514                 }
515
516                 if (updateWorkingDirectory) {
517                         prefs.put("workingDirectory", selectedFile.getPath());
518                 }
519
520                 if (!multipleSelection)
521                         return selectedFile.getAbsolutePath();
522                 else {
523                         File[] files = fc.getSelectedFiles();
524                         String[] filenames = new String[files.length];
525                         for (int i = 0; i < files.length; i++)
526                                 filenames[i] = files[i].getAbsolutePath();
527                         return filenames;
528                 }
529         }
530
531         private static String getNewFileForMac(JFrame owner, File directory, String extensions,
532                 int dialogType, boolean updateWorkingDirectory, boolean dirOnly, FilenameFilter filter) {
533
534                 FileDialog fc = new FileDialog(owner);
535
536                 // fc.setFilenameFilter(filter);
537                 if (directory != null) {
538                         fc.setDirectory(directory.getParent());
539                 }
540                 if (dialogType == JFileChooser.OPEN_DIALOG) {
541                         fc.setMode(FileDialog.LOAD);
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                 } else {
552                         return null;
553                 }
554         }
555
556         public static String SPECIAL_COMMAND_CHARS = "\"`^~'c";
557
558         public static HashMap<String, String> HTML_CHARS = new HashMap<String, String>(), HTMLCHARS = new HashMap<String, String>(),
559                 XML_CHARS = new HashMap<String, String>(), ASCII2XML_CHARS = new HashMap<String, String>(), UNICODE_CHARS = new HashMap<String, String>(),
560                 RTFCHARS = new HashMap<String, String>(), URL_CHARS = new HashMap<String,String>();
561
562         static {
563
564                 // System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish
565                 // Biology", true));
566                 // System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish
567                 // Biology", false));
568                 // System.out.println(journalAbbrev.getFullName("Aquaculture Eng."));
569                 /*
570                  * for (Iterator i=journalAbbrev.fullNameIterator(); i.hasNext();) {
571                  * String s = (String)i.next();
572                  * System.out.println(journalAbbrev.getFullName(s)+" :
573                  * "+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                 // HTMLCHARS.put("\"a", "&auml;");
597                 // HTMLCHARS.put("\"A", "&Auml;");
598                 // HTMLCHARS.put("\"e", "&euml;");
599                 // HTMLCHARS.put("\"E", "&Euml;");
600                 // HTMLCHARS.put("\"i", "&iuml;");
601                 // HTMLCHARS.put("\"I", "&Iuml;");
602                 // HTMLCHARS.put("\"o", "&ouml;");
603                 // HTMLCHARS.put("\"O", "&Ouml;");
604                 // HTMLCHARS.put("\"u", "&uuml;");
605                 // HTMLCHARS.put("\"U", "&Uuml;");
606                 // HTMLCHARS.put("`a", "&agrave;");
607                 // HTMLCHARS.put("`A", "&Agrave;");
608                 // HTMLCHARS.put("`e", "&egrave;");
609                 // HTMLCHARS.put("`E", "&Egrave;");
610                 // HTMLCHARS.put("`i", "&igrave;");
611                 // HTMLCHARS.put("`I", "&Igrave;");
612                 // HTMLCHARS.put("`o", "&ograve;");
613                 // HTMLCHARS.put("`O", "&Ograve;");
614                 // HTMLCHARS.put("`u", "&ugrave;");
615                 // HTMLCHARS.put("`U", "&Ugrave;");
616                 // HTMLCHARS.put("'e", "&eacute;");
617                 // HTMLCHARS.put("'E", "&Eacute;");
618                 // HTMLCHARS.put("'i", "&iacute;");
619                 // HTMLCHARS.put("'I", "&Iacute;");
620                 // HTMLCHARS.put("'o", "&oacute;");
621                 // HTMLCHARS.put("'O", "&Oacute;");
622                 // HTMLCHARS.put("'u", "&uacute;");
623                 // HTMLCHARS.put("'U", "&Uacute;");
624                 // HTMLCHARS.put("'a", "&aacute;");
625                 // HTMLCHARS.put("'A", "&Aacute;");
626                 // HTMLCHARS.put("^a", "&ocirc;");
627                 // HTMLCHARS.put("^A", "&Ocirc;");
628                 // HTMLCHARS.put("^o", "&ocirc;");
629                 // HTMLCHARS.put("^O", "&Ocirc;");
630                 // HTMLCHARS.put("^u", "&ucirc;");
631                 // HTMLCHARS.put("^U", "&Ucirc;");
632                 // HTMLCHARS.put("^e", "&ecirc;");
633                 // HTMLCHARS.put("^E", "&Ecirc;");
634                 // HTMLCHARS.put("^i", "&icirc;");
635                 // HTMLCHARS.put("^I", "&Icirc;");
636                 // HTMLCHARS.put("~o", "&otilde;");
637                 // HTMLCHARS.put("~O", "&Otilde;");
638                 // HTMLCHARS.put("~n", "&ntilde;");
639                 // HTMLCHARS.put("~N", "&Ntilde;");
640                 // HTMLCHARS.put("~a", "&atilde;");
641                 // HTMLCHARS.put("~A", "&Atilde;");
642                 // HTMLCHARS.put("cc", "&ccedil;");
643                 // HTMLCHARS.put("cC", "&Ccedil;");
644
645                 // Following character definitions contributed by Ervin Kolenovic:
646                 // HTML named entities from #192 - #255 (UNICODE Latin-1)
647                 HTMLCHARS.put("`A", "&Agrave;"); // #192
648                 HTMLCHARS.put("'A", "&Aacute;"); // #193
649                 HTMLCHARS.put("^A", "&Acirc;"); // #194
650                 HTMLCHARS.put("~A", "&Atilde;"); // #195
651                 HTMLCHARS.put("\"A", "&Auml;"); // #196
652                 HTMLCHARS.put("AA", "&Aring;"); // #197
653                 HTMLCHARS.put("AE", "&AElig;"); // #198
654                 HTMLCHARS.put("cC", "&Ccedil;"); // #199
655                 HTMLCHARS.put("`E", "&Egrave;"); // #200
656                 HTMLCHARS.put("'E", "&Eacute;"); // #201
657                 HTMLCHARS.put("^E", "&Ecirc;"); // #202
658                 HTMLCHARS.put("\"E", "&Euml;"); // #203
659                 HTMLCHARS.put("`I", "&Igrave;"); // #204
660                 HTMLCHARS.put("'I", "&Iacute;"); // #205
661                 HTMLCHARS.put("^I", "&Icirc;"); // #206
662                 HTMLCHARS.put("\"I", "&Iuml;"); // #207
663                 HTMLCHARS.put("DH", "&ETH;"); // #208
664                 HTMLCHARS.put("~N", "&Ntilde;"); // #209
665                 HTMLCHARS.put("`O", "&Ograve;"); // #210
666                 HTMLCHARS.put("'O", "&Oacute;"); // #211
667                 HTMLCHARS.put("^O", "&Ocirc;"); // #212
668                 HTMLCHARS.put("~O", "&Otilde;"); // #213
669                 HTMLCHARS.put("\"O", "&Ouml;"); // #214
670                 // According to ISO 8859-1 the "\times" symbol should be placed here
671                 // (#215).
672                 // Omitting this, because it is a mathematical symbol.
673                 HTMLCHARS.put("O", "&Oslash;"); // #216
674                 HTMLCHARS.put("`U", "&Ugrave;"); // #217
675                 HTMLCHARS.put("'U", "&Uacute;"); // #218
676                 HTMLCHARS.put("^U", "&Ucirc;"); // #219
677                 HTMLCHARS.put("\"U", "&Uuml;"); // #220
678                 HTMLCHARS.put("'Y", "&Yacute;"); // #221
679                 HTMLCHARS.put("TH", "&THORN;"); // #222
680                 HTMLCHARS.put("ss", "&szlig;"); // #223
681                 HTMLCHARS.put("`a", "&agrave;"); // #224
682                 HTMLCHARS.put("'a", "&aacute;"); // #225
683                 HTMLCHARS.put("^a", "&acirc;"); // #226
684                 HTMLCHARS.put("~a", "&atilde;"); // #227
685                 HTMLCHARS.put("\"a", "&auml;"); // #228
686                 HTMLCHARS.put("aa", "&aring;"); // #229
687                 HTMLCHARS.put("ae", "&aelig;"); // #230
688                 HTMLCHARS.put("cc", "&ccedil;"); // #231
689                 HTMLCHARS.put("`e", "&egrave;"); // #232
690                 HTMLCHARS.put("'e", "&eacute;"); // #233
691                 HTMLCHARS.put("^e", "&ecirc;"); // #234
692                 HTMLCHARS.put("\"e", "&euml;"); // #235
693                 HTMLCHARS.put("`i", "&igrave;"); // #236
694                 HTMLCHARS.put("'i", "&iacute;"); // #237
695                 HTMLCHARS.put("^i", "&icirc;"); // #238
696                 HTMLCHARS.put("\"i", "&iuml;"); // #239
697                 HTMLCHARS.put("dh", "&eth;"); // #240
698                 HTMLCHARS.put("~n", "&ntilde;"); // #241
699                 HTMLCHARS.put("`o", "&ograve;"); // #242
700                 HTMLCHARS.put("'o", "&oacute;"); // #243
701                 HTMLCHARS.put("^o", "&ocirc;"); // #244
702                 HTMLCHARS.put("~o", "&otilde;"); // #245
703                 HTMLCHARS.put("\"o", "&ouml;"); // #246
704                 // According to ISO 8859-1 the "\div" symbol should be placed here
705                 // (#247).
706                 // Omitting this, because it is a mathematical symbol.
707                 HTMLCHARS.put("o", "&oslash;"); // #248
708                 HTMLCHARS.put("`u", "&ugrave;"); // #249
709                 HTMLCHARS.put("'u", "&uacute;"); // #250
710                 HTMLCHARS.put("^u", "&ucirc;"); // #251
711                 HTMLCHARS.put("\"u", "&uuml;"); // #252
712                 HTMLCHARS.put("'y", "&yacute;"); // #253
713                 HTMLCHARS.put("th", "&thorn;"); // #254
714                 HTMLCHARS.put("\"y", "&yuml;"); // #255
715
716                 // HTML special characters without names (UNICODE Latin Extended-A),
717                 // 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         HTMLCHARS.put("%", "%"); // percent sign
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                 XML_CHARS.put("\\{\\\\\\\"a\\}", "&#x00E4;");
894                 XML_CHARS.put("\\{\\\\\\\"A\\}", "&#x00C4;");
895                 XML_CHARS.put("\\{\\\\\\\"e\\}", "&#x00EB;");
896                 XML_CHARS.put("\\{\\\\\\\"E\\}", "&#x00CB;");
897                 XML_CHARS.put("\\{\\\\\\\"i\\}", "&#x00EF;");
898                 XML_CHARS.put("\\{\\\\\\\"I\\}", "&#x00CF;");
899                 XML_CHARS.put("\\{\\\\\\\"o\\}", "&#x00F6;");
900                 XML_CHARS.put("\\{\\\\\\\"O\\}", "&#x00D6;");
901                 XML_CHARS.put("\\{\\\\\\\"u\\}", "&#x00FC;");
902                 XML_CHARS.put("\\{\\\\\\\"U\\}", "&#x00DC;");
903
904                 XML_CHARS.put("\\{\\\\\\`e\\}", "&#x00E8;");
905                 XML_CHARS.put("\\{\\\\\\`E\\}", "&#x00C8;");
906                 XML_CHARS.put("\\{\\\\\\`i\\}", "&#x00EC;");
907                 XML_CHARS.put("\\{\\\\\\`I\\}", "&#x00CC;");
908                 XML_CHARS.put("\\{\\\\\\`o\\}", "&#x00F2;");
909                 XML_CHARS.put("\\{\\\\\\`O\\}", "&#x00D2;");
910                 XML_CHARS.put("\\{\\\\\\`u\\}", "&#x00F9;");
911                 XML_CHARS.put("\\{\\\\\\`U\\}", "&#x00D9;");
912                 XML_CHARS.put("\\{\\\\\\'e\\}", "&#x00E9;");
913                 XML_CHARS.put("\\{\\\\\\'E\\}", "&#x00C9;");
914                 XML_CHARS.put("\\{\\\\\\'i\\}", "&#x00ED;");
915                 XML_CHARS.put("\\{\\\\\\'I\\}", "&#x00CD;");
916                 XML_CHARS.put("\\{\\\\\\'o\\}", "&#x00F3;");
917                 XML_CHARS.put("\\{\\\\\\'O\\}", "&#x00D3;");
918                 XML_CHARS.put("\\{\\\\\\'u\\}", "&#x00FA;");
919                 XML_CHARS.put("\\{\\\\\\'U\\}", "&#x00DA;");
920                 XML_CHARS.put("\\{\\\\\\'a\\}", "&#x00E1;");
921                 XML_CHARS.put("\\{\\\\\\'A\\}", "&#x00C1;");
922
923                 XML_CHARS.put("\\{\\\\\\^a\\}", "&#x00F4;");
924                 XML_CHARS.put("\\{\\\\\\^A\\}", "&#x00D4;");
925                 XML_CHARS.put("\\{\\\\\\^o\\}", "&#x00F4;");
926                 XML_CHARS.put("\\{\\\\\\^O\\}", "&#x00D4;");
927                 XML_CHARS.put("\\{\\\\\\^u\\}", "&#x00F9;");
928                 XML_CHARS.put("\\{\\\\\\^U\\}", "&#x00D9;");
929                 XML_CHARS.put("\\{\\\\\\^e\\}", "&#x00EA;");
930                 XML_CHARS.put("\\{\\\\\\^E\\}", "&#x00CA;");
931                 XML_CHARS.put("\\{\\\\\\^i\\}", "&#x00EE;");
932                 XML_CHARS.put("\\{\\\\\\^I\\}", "&#x00CE;");
933                 XML_CHARS.put("\\{\\\\\\~o\\}", "&#x00F5;");
934                 XML_CHARS.put("\\{\\\\\\~O\\}", "&#x00D5;");
935                 XML_CHARS.put("\\{\\\\\\~n\\}", "&#x00F1;");
936                 XML_CHARS.put("\\{\\\\\\~N\\}", "&#x00D1;");
937                 XML_CHARS.put("\\{\\\\\\~a\\}", "&#x00E3;");
938                 XML_CHARS.put("\\{\\\\\\~A\\}", "&#x00C3;");
939
940                 ASCII2XML_CHARS.put("<", "&lt;");
941                 ASCII2XML_CHARS.put("\"", "&quot;");
942                 ASCII2XML_CHARS.put(">", "&gt;");
943
944                 UNICODE_CHARS.put("\u00C0", "A");
945                 UNICODE_CHARS.put("\u00C1", "A");
946                 UNICODE_CHARS.put("\u00C2", "A");
947                 UNICODE_CHARS.put("\u00C3", "A");
948                 UNICODE_CHARS.put("\u00C4", "Ae");
949                 UNICODE_CHARS.put("\u00C5", "Aa");
950                 UNICODE_CHARS.put("\u00C6", "Ae");
951                 UNICODE_CHARS.put("\u00C7", "C");
952                 UNICODE_CHARS.put("\u00C8", "E");
953                 UNICODE_CHARS.put("\u00C9", "E");
954                 UNICODE_CHARS.put("\u00CA", "E");
955                 UNICODE_CHARS.put("\u00CB", "E");
956                 UNICODE_CHARS.put("\u00CC", "I");
957                 UNICODE_CHARS.put("\u00CD", "I");
958                 UNICODE_CHARS.put("\u00CE", "I");
959                 UNICODE_CHARS.put("\u00CF", "I");
960                 UNICODE_CHARS.put("\u00D0", "D");
961                 UNICODE_CHARS.put("\u00D1", "N");
962                 UNICODE_CHARS.put("\u00D2", "O");
963                 UNICODE_CHARS.put("\u00D3", "O");
964                 UNICODE_CHARS.put("\u00D4", "O");
965                 UNICODE_CHARS.put("\u00D5", "O");
966                 UNICODE_CHARS.put("\u00D6", "Oe");
967                 UNICODE_CHARS.put("\u00D8", "Oe");
968                 UNICODE_CHARS.put("\u00D9", "U");
969                 UNICODE_CHARS.put("\u00DA", "U");
970                 UNICODE_CHARS.put("\u00DB", "U");
971                 UNICODE_CHARS.put("\u00DC", "Ue"); // U umlaut ..
972                 UNICODE_CHARS.put("\u00DD", "Y");
973                 UNICODE_CHARS.put("\u00DF", "ss");
974                 UNICODE_CHARS.put("\u00E0", "a");
975                 UNICODE_CHARS.put("\u00E1", "a");
976                 UNICODE_CHARS.put("\u00E2", "a");
977                 UNICODE_CHARS.put("\u00E3", "a");
978                 UNICODE_CHARS.put("\u00E4", "ae");
979                 UNICODE_CHARS.put("\u00E5", "aa");
980                 UNICODE_CHARS.put("\u00E6", "ae");
981                 UNICODE_CHARS.put("\u00E7", "c");
982                 UNICODE_CHARS.put("\u00E8", "e");
983                 UNICODE_CHARS.put("\u00E9", "e");
984                 UNICODE_CHARS.put("\u00EA", "e");
985                 UNICODE_CHARS.put("\u00EB", "e");
986                 UNICODE_CHARS.put("\u00EC", "i");
987                 UNICODE_CHARS.put("\u00ED", "i");
988                 UNICODE_CHARS.put("\u00EE", "i");
989                 UNICODE_CHARS.put("\u00EF", "i");
990                 UNICODE_CHARS.put("\u00F0", "o");
991                 UNICODE_CHARS.put("\u00F1", "n");
992                 UNICODE_CHARS.put("\u00F2", "o");
993                 UNICODE_CHARS.put("\u00F3", "o");
994                 UNICODE_CHARS.put("\u00F4", "o");
995                 UNICODE_CHARS.put("\u00F5", "o");
996                 UNICODE_CHARS.put("\u00F6", "oe");
997                 UNICODE_CHARS.put("\u00F8", "oe");
998                 UNICODE_CHARS.put("\u00F9", "u");
999                 UNICODE_CHARS.put("\u00FA", "u");
1000                 UNICODE_CHARS.put("\u00FB", "u");
1001                 UNICODE_CHARS.put("\u00FC", "ue"); // u umlaut...
1002                 UNICODE_CHARS.put("\u00FD", "y");
1003                 UNICODE_CHARS.put("\u00FF", "y");
1004                 UNICODE_CHARS.put("\u0100", "A");
1005                 UNICODE_CHARS.put("\u0101", "a");
1006                 UNICODE_CHARS.put("\u0102", "A");
1007                 UNICODE_CHARS.put("\u0103", "a");
1008                 UNICODE_CHARS.put("\u0104", "A");
1009                 UNICODE_CHARS.put("\u0105", "a");
1010                 UNICODE_CHARS.put("\u0106", "C");
1011                 UNICODE_CHARS.put("\u0107", "c");
1012                 UNICODE_CHARS.put("\u0108", "C");
1013                 UNICODE_CHARS.put("\u0109", "c");
1014                 UNICODE_CHARS.put("\u010A", "C");
1015                 UNICODE_CHARS.put("\u010B", "c");
1016                 UNICODE_CHARS.put("\u010C", "C");
1017                 UNICODE_CHARS.put("\u010D", "c");
1018                 UNICODE_CHARS.put("\u010E", "D");
1019                 UNICODE_CHARS.put("\u010F", "d");
1020                 UNICODE_CHARS.put("\u0110", "D");
1021                 UNICODE_CHARS.put("\u0111", "d");
1022                 UNICODE_CHARS.put("\u0112", "E");
1023                 UNICODE_CHARS.put("\u0113", "e");
1024                 UNICODE_CHARS.put("\u0114", "E");
1025                 UNICODE_CHARS.put("\u0115", "e");
1026                 UNICODE_CHARS.put("\u0116", "E");
1027                 UNICODE_CHARS.put("\u0117", "e");
1028                 UNICODE_CHARS.put("\u0118", "E");
1029                 UNICODE_CHARS.put("\u0119", "e");
1030                 UNICODE_CHARS.put("\u011A", "E");
1031                 UNICODE_CHARS.put("\u011B", "e");
1032                 UNICODE_CHARS.put("\u011C", "G");
1033                 UNICODE_CHARS.put("\u011D", "g");
1034                 UNICODE_CHARS.put("\u011E", "G");
1035                 UNICODE_CHARS.put("\u011F", "g");
1036                 UNICODE_CHARS.put("\u0120", "G");
1037                 UNICODE_CHARS.put("\u0121", "g");
1038                 UNICODE_CHARS.put("\u0122", "G");
1039                 UNICODE_CHARS.put("\u0123", "g");
1040                 UNICODE_CHARS.put("\u0124", "H");
1041                 UNICODE_CHARS.put("\u0125", "h");
1042                 UNICODE_CHARS.put("\u0127", "h");
1043                 UNICODE_CHARS.put("\u0128", "I");
1044                 UNICODE_CHARS.put("\u0129", "i");
1045                 UNICODE_CHARS.put("\u012A", "I");
1046                 UNICODE_CHARS.put("\u012B", "i");
1047                 UNICODE_CHARS.put("\u012C", "I");
1048                 UNICODE_CHARS.put("\u012D", "i");
1049                 // UNICODE_CHARS.put("\u0100", "");
1050
1051                 RTFCHARS.put("`a", "\\'e0");
1052                 RTFCHARS.put("`e", "\\'e8");
1053                 RTFCHARS.put("`i", "\\'ec");
1054                 RTFCHARS.put("`o", "\\'f2");
1055                 RTFCHARS.put("`u", "\\'f9");
1056                 RTFCHARS.put("?a", "\\'e1");
1057                 RTFCHARS.put("?e", "\\'e9");
1058                 RTFCHARS.put("?i", "\\'ed");
1059                 RTFCHARS.put("?o", "\\'f3");
1060                 RTFCHARS.put("?u", "\\'fa");
1061                 RTFCHARS.put("^a", "\\'e2");
1062                 RTFCHARS.put("^e", "\\'ea");
1063                 RTFCHARS.put("^i", "\\'ee");
1064                 RTFCHARS.put("^o", "\\'f4");
1065                 RTFCHARS.put("^u", "\\'fa");
1066                 RTFCHARS.put("\"a", "\\'e4");
1067                 RTFCHARS.put("\"e", "\\'eb");
1068                 RTFCHARS.put("\"i", "\\'ef");
1069                 RTFCHARS.put("\"o", "\\'f6");
1070                 RTFCHARS.put("\"u", "\\u252u");
1071                 RTFCHARS.put("~n", "\\'f1");
1072                 RTFCHARS.put("`A", "\\'c0");
1073                 RTFCHARS.put("`E", "\\'c8");
1074                 RTFCHARS.put("`I", "\\'cc");
1075                 RTFCHARS.put("`O", "\\'d2");
1076                 RTFCHARS.put("`U", "\\'d9");
1077                 RTFCHARS.put("?A", "\\'c1");
1078                 RTFCHARS.put("?E", "\\'c9");
1079                 RTFCHARS.put("?I", "\\'cd");
1080                 RTFCHARS.put("?O", "\\'d3");
1081                 RTFCHARS.put("?U", "\\'da");
1082                 RTFCHARS.put("^A", "\\'c2");
1083                 RTFCHARS.put("^E", "\\'ca");
1084                 RTFCHARS.put("^I", "\\'ce");
1085                 RTFCHARS.put("^O", "\\'d4");
1086                 RTFCHARS.put("^U", "\\'db");
1087                 RTFCHARS.put("\"A", "\\'c4");
1088                 RTFCHARS.put("\"E", "\\'cb");
1089                 RTFCHARS.put("\"I", "\\'cf");
1090                 RTFCHARS.put("\"O", "\\'d6");
1091                 RTFCHARS.put("\"U", "\\'dc");
1092                 
1093                 // Use UNICODE characters for RTF-Chars which can not be found in the
1094                 // standard codepage
1095
1096                 // RTFCHARS.put("`A", "\\u192"); // "Agrave" exists in standard
1097                 // codepage
1098                 RTFCHARS.put("'A", "\\u193A"); // "Aacute"
1099                 // RTFCHARS.put("^A", "\\u194"); // "Acirc" exists in standard
1100                 // codepage
1101                 RTFCHARS.put("~A", "\\u195A"); // "Atilde"
1102                 // RTFCHARS.put("\"A", "\\u196"); // "Auml" exists in standard
1103                 // codepage
1104                 RTFCHARS.put("AA", "\\u197A"); // "Aring"
1105                 RTFCHARS.put("AE", "{\\uc2\\u198AE}"); // "AElig"
1106                 RTFCHARS.put("cC", "\\u199C"); // "Ccedil"
1107                 // RTFCHARS.put("`E", "\\u200"); // "Egrave" exists in standard
1108                 // codepage
1109                 RTFCHARS.put("'E", "\\u201E"); // "Eacute"
1110                 // RTFCHARS.put("^E", "\\u202"); // "Ecirc" exists in standard
1111                 // codepage
1112                 // RTFCHARS.put("\"E", "\\u203"); // "Euml" exists in standard
1113                 // codepage
1114                 // RTFCHARS.put("`I", "\\u204"); // "Igrave" exists in standard
1115                 // codepage
1116                 RTFCHARS.put("'I", "\\u205I"); // "Iacute"
1117                 // RTFCHARS.put("^I", "\\u206"); // "Icirc" exists in standard
1118                 // codepage
1119                 // RTFCHARS.put("\"I", "\\u207"); // "Iuml" exists in standard
1120                 // codepage
1121                 RTFCHARS.put("DH", "\\u208D"); // "ETH"
1122                 RTFCHARS.put("~N", "\\u209N"); // "Ntilde"
1123                 // RTFCHARS.put("`O", "\\u210"); // "Ograve" exists in standard
1124                 // codepage
1125                 RTFCHARS.put("'O", "\\u211O"); // "Oacute"
1126                 // RTFCHARS.put("^O", "\\u212"); // "Ocirc" exists in standard
1127                 // codepage
1128                 RTFCHARS.put("~O", "\\u213O"); // "Otilde"
1129                 // RTFCHARS.put("\"O", "\\u214"); // "Ouml" exists in standard
1130                 // codepage
1131                 // According to ISO 8859-1 the "\times" symbol should be placed here
1132                 // (#215).
1133                 // Omitting this, because it is a mathematical symbol.
1134                 RTFCHARS.put("O", "\\u216O"); // "Oslash"
1135                 // RTFCHARS.put("`U", "\\u217"); // "Ugrave" exists in standard
1136                 // codepage
1137                 RTFCHARS.put("'U", "\\u218U"); // "Uacute"
1138                 // RTFCHARS.put("^U", "\\u219"); // "Ucirc" exists in standard
1139                 // codepage
1140                 // RTFCHARS.put("\"U", "\\u220"); // "Uuml" exists in standard
1141                 // codepage
1142                 RTFCHARS.put("'Y", "\\u221Y"); // "Yacute"
1143                 RTFCHARS.put("TH", "{\\uc2\\u222TH}"); // "THORN"
1144                 RTFCHARS.put("ss", "{\\uc2\\u223ss"); // "szlig"
1145                 // RTFCHARS.put("`a", "\\u224"); // "agrave" exists in standard
1146                 // codepage
1147                 RTFCHARS.put("'a", "\\u225a"); // "aacute"
1148                 // RTFCHARS.put("^a", "\\u226"); // "acirc" exists in standard
1149                 // codepage
1150                 RTFCHARS.put("~a", "\\u227a"); // "atilde"
1151                 // RTFCHARS.put("\"a", "\\u228"); // "auml" exists in standard
1152                 // codepage
1153                 RTFCHARS.put("aa", "\\u229a"); // "aring"
1154                 RTFCHARS.put("ae", "{\\uc2\\u230ae}"); // "aelig"
1155                 RTFCHARS.put("cc", "\\u231c"); // "ccedil"
1156                 // RTFCHARS.put("`e", "\\u232"); // "egrave" exists in standard
1157                 // codepage
1158                 RTFCHARS.put("'e", "\\u233e"); // "eacute"
1159                 // RTFCHARS.put("^e", "\\u234"); // "ecirc" exists in standard
1160                 // codepage
1161                 // RTFCHARS.put("\"e", "\\u235"); // "euml" exists in standard
1162                 // codepage
1163                 // RTFCHARS.put("`i", "\\u236"); // "igrave" exists in standard
1164                 // codepage
1165                 RTFCHARS.put("'i", "\\u237i"); // "iacute"
1166                 // RTFCHARS.put("^i", "\\u238"); // "icirc" exists in standard
1167                 // codepage
1168                 // RTFCHARS.put("\"i", "\\u239"); // "iuml" exists in standard
1169                 // codepage
1170                 RTFCHARS.put("dh", "\\u240d"); // "eth"
1171                 // RTFCHARS.put("~n", "\\u241"); // "ntilde" exists in standard
1172                 // codepage
1173                 // RTFCHARS.put("`o", "\\u242"); // "ograve" exists in standard
1174                 // codepage
1175                 RTFCHARS.put("'o", "\\u243o"); // "oacute"
1176                 // RTFCHARS.put("^o", "\\u244"); // "ocirc" exists in standard
1177                 // codepage
1178                 RTFCHARS.put("~o", "\\u245o"); // "otilde"
1179                 // RTFCHARS.put("\"o", "\\u246"); // "ouml" exists in standard
1180                 // codepage
1181                 // According to ISO 8859-1 the "\div" symbol should be placed here
1182                 // (#247).
1183                 // Omitting this, because it is a mathematical symbol.
1184                 RTFCHARS.put("o", "\\u248o"); // "oslash"
1185                 // RTFCHARS.put("`u", "\\u249"); // "ugrave" exists in standard
1186                 // codepage
1187                 RTFCHARS.put("'u", "\\u250u"); // "uacute"
1188                 // RTFCHARS.put("^u", "\\u251"); // "ucirc" exists in standard
1189                 // codepage
1190                 // RTFCHARS.put("\"u", "\\u252"); // "uuml" exists in standard
1191                 // codepage
1192                 RTFCHARS.put("'y", "\\u253y"); // "yacute"
1193                 RTFCHARS.put("th", "{\\uc2\\u254th}"); // "thorn"
1194                 RTFCHARS.put("\"y", "\\u255y"); // "yuml"
1195
1196                 RTFCHARS.put("=A", "\\u256A"); // "Amacr"
1197                 RTFCHARS.put("=a", "\\u257a"); // "amacr"
1198                 RTFCHARS.put("uA", "\\u258A"); // "Abreve"
1199                 RTFCHARS.put("ua", "\\u259a"); // "abreve"
1200                 RTFCHARS.put("kA", "\\u260A"); // "Aogon"
1201                 RTFCHARS.put("ka", "\\u261a"); // "aogon"
1202                 RTFCHARS.put("'C", "\\u262C"); // "Cacute"
1203                 RTFCHARS.put("'c", "\\u263c"); // "cacute"
1204                 RTFCHARS.put("^C", "\\u264C"); // "Ccirc"
1205                 RTFCHARS.put("^c", "\\u265c"); // "ccirc"
1206                 RTFCHARS.put(".C", "\\u266C"); // "Cdot"
1207                 RTFCHARS.put(".c", "\\u267c"); // "cdot"
1208                 RTFCHARS.put("vC", "\\u268C"); // "Ccaron"
1209                 RTFCHARS.put("vc", "\\u269c"); // "ccaron"
1210                 RTFCHARS.put("vD", "\\u270D"); // "Dcaron"
1211                 // Symbol #271 (d�) has no special Latex command
1212                 RTFCHARS.put("DJ", "\\u272D"); // "Dstrok"
1213                 RTFCHARS.put("dj", "\\u273d"); // "dstrok"
1214                 RTFCHARS.put("=E", "\\u274E"); // "Emacr"
1215                 RTFCHARS.put("=e", "\\u275e"); // "emacr"
1216                 RTFCHARS.put("uE", "\\u276E"); // "Ebreve"
1217                 RTFCHARS.put("ue", "\\u277e"); // "ebreve"
1218                 RTFCHARS.put(".E", "\\u278E"); // "Edot"
1219                 RTFCHARS.put(".e", "\\u279e"); // "edot"
1220                 RTFCHARS.put("kE", "\\u280E"); // "Eogon"
1221                 RTFCHARS.put("ke", "\\u281e"); // "eogon"
1222                 RTFCHARS.put("vE", "\\u282E"); // "Ecaron"
1223                 RTFCHARS.put("ve", "\\u283e"); // "ecaron"
1224                 RTFCHARS.put("^G", "\\u284G"); // "Gcirc"
1225                 RTFCHARS.put("^g", "\\u285g"); // "gcirc"
1226                 RTFCHARS.put("uG", "\\u286G"); // "Gbreve"
1227                 RTFCHARS.put("ug", "\\u287g"); // "gbreve"
1228                 RTFCHARS.put(".G", "\\u288G"); // "Gdot"
1229                 RTFCHARS.put(".g", "\\u289g"); // "gdot"
1230                 RTFCHARS.put("cG", "\\u290G"); // "Gcedil"
1231                 RTFCHARS.put("'g", "\\u291g"); // "gacute"
1232                 RTFCHARS.put("^H", "\\u292H"); // "Hcirc"
1233                 RTFCHARS.put("^h", "\\u293h"); // "hcirc"
1234                 RTFCHARS.put("Hstrok", "\\u294H"); // "Hstrok"
1235                 RTFCHARS.put("hstrok", "\\u295h"); // "hstrok"
1236                 RTFCHARS.put("~I", "\\u296I"); // "Itilde"
1237                 RTFCHARS.put("~i", "\\u297i"); // "itilde"
1238                 RTFCHARS.put("=I", "\\u298I"); // "Imacr"
1239                 RTFCHARS.put("=i", "\\u299i"); // "imacr"
1240                 RTFCHARS.put("uI", "\\u300I"); // "Ibreve"
1241                 RTFCHARS.put("ui", "\\u301i"); // "ibreve"
1242                 RTFCHARS.put("kI", "\\u302I"); // "Iogon"
1243                 RTFCHARS.put("ki", "\\u303i"); // "iogon"
1244                 RTFCHARS.put(".I", "\\u304I"); // "Idot"
1245                 RTFCHARS.put("i", "\\u305i"); // "inodot"
1246                 // Symbol #306 (IJ) has no special Latex command
1247                 // Symbol #307 (ij) has no special Latex command
1248                 RTFCHARS.put("^J", "\\u308J"); // "Jcirc"
1249                 RTFCHARS.put("^j", "\\u309j"); // "jcirc"
1250                 RTFCHARS.put("cK", "\\u310K"); // "Kcedil"
1251                 RTFCHARS.put("ck", "\\u311k"); // "kcedil"
1252                 // Symbol #312 (k) has no special Latex command
1253                 RTFCHARS.put("'L", "\\u313L"); // "Lacute"
1254                 RTFCHARS.put("'l", "\\u314l"); // "lacute"
1255                 RTFCHARS.put("cL", "\\u315L"); // "Lcedil"
1256                 RTFCHARS.put("cl", "\\u316l"); // "lcedil"
1257                 // Symbol #317 (L�) has no special Latex command
1258                 // Symbol #318 (l�) has no special Latex command
1259                 RTFCHARS.put("Lmidot", "\\u319L"); // "Lmidot"
1260                 RTFCHARS.put("lmidot", "\\u320l"); // "lmidot"
1261                 RTFCHARS.put("L", "\\u321L"); // "Lstrok"
1262                 RTFCHARS.put("l", "\\u322l"); // "lstrok"
1263                 RTFCHARS.put("'N", "\\u323N"); // "Nacute"
1264                 RTFCHARS.put("'n", "\\u324n"); // "nacute"
1265                 RTFCHARS.put("cN", "\\u325N"); // "Ncedil"
1266                 RTFCHARS.put("cn", "\\u326n"); // "ncedil"
1267                 RTFCHARS.put("vN", "\\u327N"); // "Ncaron"
1268                 RTFCHARS.put("vn", "\\u328n"); // "ncaron"
1269                 // Symbol #329 (�n) has no special Latex command
1270                 RTFCHARS.put("NG", "\\u330G"); // "ENG"
1271                 RTFCHARS.put("ng", "\\u331g"); // "eng"
1272                 RTFCHARS.put("=O", "\\u332O"); // "Omacr"
1273                 RTFCHARS.put("=o", "\\u333o"); // "omacr"
1274                 RTFCHARS.put("uO", "\\u334O"); // "Obreve"
1275                 RTFCHARS.put("uo", "\\u335o"); // "obreve"
1276                 RTFCHARS.put("HO", "\\u336?"); // "Odblac"
1277                 RTFCHARS.put("Ho", "\\u337?"); // "odblac"
1278                 RTFCHARS.put("OE", "{\\uc2\\u338OE}"); // "OElig"
1279                 RTFCHARS.put("oe", "{\\uc2\\u339oe}"); // "oelig"
1280                 RTFCHARS.put("'R", "\\u340R"); // "Racute"
1281                 RTFCHARS.put("'r", "\\u341r"); // "racute"
1282                 RTFCHARS.put("cR", "\\u342R"); // "Rcedil"
1283                 RTFCHARS.put("cr", "\\u343r"); // "rcedil"
1284                 RTFCHARS.put("vR", "\\u344R"); // "Rcaron"
1285                 RTFCHARS.put("vr", "\\u345r"); // "rcaron"
1286                 RTFCHARS.put("'S", "\\u346S"); // "Sacute"
1287                 RTFCHARS.put("'s", "\\u347s"); // "sacute"
1288                 RTFCHARS.put("^S", "\\u348S"); // "Scirc"
1289                 RTFCHARS.put("^s", "\\u349s"); // "scirc"
1290                 RTFCHARS.put("cS", "\\u350S"); // "Scedil"
1291                 RTFCHARS.put("cs", "\\u351s"); // "scedil"
1292                 RTFCHARS.put("vS", "\\u352S"); // "Scaron"
1293                 RTFCHARS.put("vs", "\\u353s"); // "scaron"
1294                 RTFCHARS.put("cT", "\\u354T"); // "Tcedil"
1295                 RTFCHARS.put("ct", "\\u355t"); // "tcedil"
1296                 RTFCHARS.put("vT", "\\u356T"); // "Tcaron"
1297                 // Symbol #357 (t�) has no special Latex command
1298                 RTFCHARS.put("Tstrok", "\\u358T"); // "Tstrok"
1299                 RTFCHARS.put("tstrok", "\\u359t"); // "tstrok"
1300                 RTFCHARS.put("~U", "\\u360U"); // "Utilde"
1301                 RTFCHARS.put("~u", "\\u361u"); // "utilde"
1302                 RTFCHARS.put("=U", "\\u362U"); // "Umacr"
1303                 RTFCHARS.put("=u", "\\u363u"); // "umacr"
1304                 RTFCHARS.put("uU", "\\u364U"); // "Ubreve"
1305                 RTFCHARS.put("uu", "\\u365u"); // "ubreve"
1306                 RTFCHARS.put("rU", "\\u366U"); // "Uring"
1307                 RTFCHARS.put("ru", "\\u367u"); // "uring"
1308                 RTFCHARS.put("HU", "\\u368?"); // "Odblac"
1309                 RTFCHARS.put("Hu", "\\u369?"); // "odblac"
1310                 RTFCHARS.put("kU", "\\u370U"); // "Uogon"
1311                 RTFCHARS.put("ku", "\\u371u"); // "uogon"
1312                 RTFCHARS.put("^W", "\\u372W"); // "Wcirc"
1313                 RTFCHARS.put("^w", "\\u373w"); // "wcirc"
1314                 RTFCHARS.put("^Y", "\\u374Y"); // "Ycirc"
1315                 RTFCHARS.put("^y", "\\u375y"); // "ycirc"
1316                 RTFCHARS.put("\"Y","\\u376Y"); // "Yuml"
1317                 RTFCHARS.put("'Z", "\\u377Z"); // "Zacute"
1318                 RTFCHARS.put("'z", "\\u378z"); // "zacute"
1319                 RTFCHARS.put(".Z", "\\u379Z"); // "Zdot"
1320                 RTFCHARS.put(".z", "\\u380z"); // "zdot"
1321                 RTFCHARS.put("vZ", "\\u381Z"); // "Zcaron"
1322                 RTFCHARS.put("vz", "\\u382z"); // "zcaron"
1323                 // Symbol #383 (f) has no special Latex command
1324
1325                 // XML_CHARS.put("\\u00E1", "&#x00E1;");
1326         }
1327
1328         public static void initializeJournalNames() {
1329                 journalAbbrev = new JournalAbbreviations();// "/resource/journalList.txt");
1330
1331                 // Read external lists, if any (in reverse order, so the upper lists
1332                 // override the lower):
1333                 String[] lists = prefs.getStringArray("externalJournalLists");
1334                 if ((lists != null) && (lists.length > 0)) {
1335                         for (int i = lists.length - 1; i >= 0; i--) {
1336                                 try {
1337                                         journalAbbrev.readJournalList(new File(lists[i]));
1338                                 } catch (FileNotFoundException e) {
1339                                         // The file couldn't be found... should we tell anyone?
1340                                         Globals.logger(e.getMessage());
1341                                 }
1342                         }
1343                 }
1344
1345                 // Read personal list, if set up:
1346                 if (prefs.get("personalJournalList") != null) {
1347                         try {
1348                                 journalAbbrev.readJournalList(new File(prefs.get("personalJournalList")));
1349                         } catch (FileNotFoundException e) {
1350                                 Globals.logger("Personal journal list file '" + prefs.get("personalJournalList")
1351                                         + "' not found.");
1352                         }
1353                 }
1354
1355         }
1356
1357 }