1 /* (C) 2003 Nizar N. Batada, Morten O. Alver
3 All programs in this directory and
4 subdirectories are published under the GNU General Public License as
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.
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.
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
22 Further information about the GNU GPL is available at:
23 http://www.gnu.org/copyleft/gpl.ja.html
26 package net.sf.jabref;
28 import java.awt.FileDialog;
29 import java.awt.Toolkit;
31 import java.io.FileNotFoundException;
32 import java.io.FilenameFilter;
33 import java.nio.charset.Charset;
34 import java.util.ArrayList;
35 import java.util.HashMap;
36 import java.util.List;
37 import java.util.Locale;
39 import java.util.MissingResourceException;
40 import java.util.ResourceBundle;
41 import java.util.logging.ConsoleHandler;
42 import java.util.logging.Filter;
43 import java.util.logging.Handler;
44 import java.util.logging.LogRecord;
45 import java.util.logging.Logger;
47 import javax.swing.JComponent;
48 import javax.swing.JFileChooser;
49 import javax.swing.JFrame;
51 import net.sf.jabref.collab.FileUpdateMonitor;
52 import net.sf.jabref.imports.ImportFormatReader;
53 import net.sf.jabref.journals.JournalAbbreviations;
54 import net.sf.jabref.util.ErrorConsole;
55 import net.sf.jabref.util.TBuildInfo;
57 public class Globals {
59 public static int SHORTCUT_MASK,// =
60 // Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
61 FUTURE_YEAR = 2050, // Needs to give a year definitely in the future.
62 // Used for guessing the
63 // year field when parsing textual data. :-)
65 STANDARD_EXPORT_COUNT = 5, // The number of standard export formats.
66 METADATA_LINE_LENGTH = 70; // The line length used to wrap metadata.
68 private static String resourcePrefix = "resource/JabRef", menuResourcePrefix = "resource/Menu",
69 integrityResourcePrefix = "resource/IntegrityMessage";
71 private static final String buildInfos = "/resource/build.properties";
74 * some extra field definitions
76 public static final String additionalFields = "/resource/fields/fields.xml";
78 public static ResourceBundle messages, menuTitles, intMessages;
80 public static FileUpdateMonitor fileUpdateMonitor = new FileUpdateMonitor();
82 public static ImportFormatReader importFormatReader = new ImportFormatReader();
84 public static ErrorConsole errorConsole;
86 public static String VERSION, BUILD, BUILD_DATE;
89 TBuildInfo bi = new TBuildInfo(buildInfos);
90 VERSION = bi.getBUILD_VERSION();
91 BUILD = bi.getBUILD_NUMBER();
92 BUILD_DATE = bi.getBUILD_DATE();
94 // TODO: Error console initialization here. When should it be used?
95 errorConsole = ErrorConsole.getInstance();
98 public static Locale locale;
100 public static final String FILETYPE_PREFS_EXT = "_dir", SELECTOR_META_PREFIX = "selector_",
101 PROTECTED_FLAG_META = "protectedFlag",
102 LAYOUT_PREFIX = "/resource/layout/", MAC = "Mac OS X",
103 DOI_LOOKUP_PREFIX = "http://dx.doi.org/", NONE = "_non__",
104 FORMATTER_PACKAGE = "net.sf.jabref.export.layout.format.";
106 public static float duplicateThreshold = 0.75f;
108 private static Handler consoleHandler = new java.util.logging.ConsoleHandler();
110 public static String[] ENCODINGS, ALL_ENCODINGS = // (String[])
111 // Charset.availableCharsets().keySet().toArray(new
113 new String[] { "ISO8859_1", "UTF8", "UTF-16", "ASCII", "Cp1250", "Cp1251", "Cp1252",
114 "Cp1253", "Cp1254", "Cp1257", "SJIS",
115 "EUC_JP", // Added Japanese encodings.
116 "Big5", "Big5_HKSCS", "GBK", "ISO8859_2", "ISO8859_3", "ISO8859_4", "ISO8859_5",
117 "ISO8859_6", "ISO8859_7", "ISO8859_8", "ISO8859_9", "ISO8859_13", "ISO8859_15" };
118 public static Map<String,String> ENCODING_NAMES_LOOKUP;
120 // String array that maps from month number to month string label:
121 public static String[] MONTHS = new String[] { "jan", "feb", "mar", "apr", "may", "jun", "jul",
122 "aug", "sep", "oct", "nov", "dec" };
124 // Map that maps from month string labels to
125 public static Map<String, String> MONTH_STRINGS = new HashMap<String, String>();
127 MONTH_STRINGS.put("jan", "January");
128 MONTH_STRINGS.put("feb", "February");
129 MONTH_STRINGS.put("mar", "March");
130 MONTH_STRINGS.put("apr", "April");
131 MONTH_STRINGS.put("may", "May");
132 MONTH_STRINGS.put("jun", "June");
133 MONTH_STRINGS.put("jul", "July");
134 MONTH_STRINGS.put("aug", "August");
135 MONTH_STRINGS.put("sep", "September");
136 MONTH_STRINGS.put("oct", "October");
137 MONTH_STRINGS.put("nov", "November");
138 MONTH_STRINGS.put("dec", "December");
140 // Build list of encodings, by filtering out all that are not supported
142 List<String> encodings = new ArrayList<String>();
143 for (int i = 0; i < ALL_ENCODINGS.length; i++) {
144 if (Charset.isSupported(ALL_ENCODINGS[i])) {
145 encodings.add(ALL_ENCODINGS[i]);
148 ENCODINGS = encodings.toArray(new String[0]);
149 // Build a map for translating Java encoding names into common encoding names:
150 ENCODING_NAMES_LOOKUP = new HashMap<String,String>();
151 ENCODING_NAMES_LOOKUP.put("Cp1250", "windows-1250");
152 ENCODING_NAMES_LOOKUP.put("Cp1251", "windows-1251");
153 ENCODING_NAMES_LOOKUP.put("Cp1252", "windows-1252");
154 ENCODING_NAMES_LOOKUP.put("Cp1253", "windows-1253");
155 ENCODING_NAMES_LOOKUP.put("Cp1254", "windows-1254");
156 ENCODING_NAMES_LOOKUP.put("Cp1257", "windows-1257");
157 ENCODING_NAMES_LOOKUP.put("ISO8859_1", "ISO-8859-1");
158 ENCODING_NAMES_LOOKUP.put("ISO8859_2", "ISO-8859-2");
159 ENCODING_NAMES_LOOKUP.put("ISO8859_3", "ISO-8859-3");
160 ENCODING_NAMES_LOOKUP.put("ISO8859_4", "ISO-8859-4");
161 ENCODING_NAMES_LOOKUP.put("ISO8859_5", "ISO-8859-5");
162 ENCODING_NAMES_LOOKUP.put("ISO8859_6", "ISO-8859-6");
163 ENCODING_NAMES_LOOKUP.put("ISO8859_7", "ISO-8859-7");
164 ENCODING_NAMES_LOOKUP.put("ISO8859_8", "ISO-8859-8");
165 ENCODING_NAMES_LOOKUP.put("ISO8859_9", "ISO-8859-9");
166 ENCODING_NAMES_LOOKUP.put("ISO8859_13", "ISO-8859-13");
167 ENCODING_NAMES_LOOKUP.put("ISO8859_15", "ISO-8859-15");
168 ENCODING_NAMES_LOOKUP.put("KOI8_R", "KOI8-R");
169 ENCODING_NAMES_LOOKUP.put("UTF8", "UTF-8");
170 ENCODING_NAMES_LOOKUP.put("UTF-16", "UTF-16");
171 ENCODING_NAMES_LOOKUP.put("SJIS", "Shift_JIS");
172 ENCODING_NAMES_LOOKUP.put("GBK", "GBK");
173 ENCODING_NAMES_LOOKUP.put("Big5_HKSCS", "Big5-HKSCS");
174 ENCODING_NAMES_LOOKUP.put("Big5", "Big5");
175 ENCODING_NAMES_LOOKUP.put("EUC_JP", "EUC-JP");
176 ENCODING_NAMES_LOOKUP.put("ASCII", "US-ASCII");
179 public static GlobalFocusListener focusListener = new GlobalFocusListener();
181 public static JabRefPreferences prefs = null;
183 public static HelpDialog helpDiag = null;
185 public static String osName = System.getProperty("os.name", "def");
187 public static boolean ON_MAC = (osName.equals(MAC)), ON_WIN = osName.startsWith("Windows");
189 public static String[] SKIP_WORDS = { "a", "an", "the", "for", "on" };
191 public static SidePaneManager sidePaneManager;
193 public static final String NEWLINE = System.getProperty("line.separator");
194 public static final int NEWLINE_LENGTH = System.getProperty("line.separator").length();
196 // Instantiate logger:
197 // TODO: Doesn't work in Java 5:
198 // private static Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
199 private static Logger logger = Logger.global;
202 * true if we have unix newlines
204 public static final boolean UNIX_NEWLINE = NEWLINE.equals("\n");
207 * "Fieldname" to indicate that a field should be treated as a bibtex
208 * string. Used when writing database to file.
210 public static final String BIBTEX_STRING = "__string";
212 public static void logger(String s) {
216 public static void turnOffLogging() { // only log exceptions
217 logger.setLevel(java.util.logging.Level.SEVERE);
221 * Should be only called once
223 public static void turnOnConsoleLogging() {
224 logger.addHandler(consoleHandler);
228 * Should be only called once
230 public static void turnOnFileLogging() {
231 logger.setLevel(java.util.logging.Level.ALL);
232 java.util.logging.Handler handler;
233 handler = new ConsoleHandler();
234 logger.addHandler(handler);
236 handler.setFilter(new Filter() { // select what gets logged
237 public boolean isLoggable(LogRecord record) {
243 public static void setLanguage(String language, String country) {
244 locale = new Locale(language, country);
245 messages = ResourceBundle.getBundle(resourcePrefix, locale);
246 menuTitles = ResourceBundle.getBundle(menuResourcePrefix, locale);
247 intMessages = ResourceBundle.getBundle(integrityResourcePrefix, locale);
248 Locale.setDefault(locale);
249 javax.swing.JComponent.setDefaultLocale(locale);
252 public static JournalAbbreviations journalAbbrev;
254 public static String lang(String key, String[] params) {
255 String translation = null;
257 if (Globals.messages != null)
258 translation = Globals.messages.getString(key.replaceAll(" ", "_"));
259 } catch (MissingResourceException ex) {
260 //logger("Warning: could not get translation for \"" + key + "\"");
262 if (translation == null)
265 if ((translation != null) && (translation.length() != 0)) {
266 translation = translation.replaceAll("_", " ");
267 StringBuffer sb = new StringBuffer();
270 for (int i = 0; i < translation.length(); ++i) {
271 c = translation.charAt(i);
280 int index = Integer.parseInt(String.valueOf(c));
281 if (params != null && index >= 0 && index <= params.length)
282 sb.append(params[index]);
283 } catch (NumberFormatException e) {
284 // append literally (for quoting) or insert special
293 default: // anything else, e.g. %
300 return sb.toString();
305 public static String lang(String key) {
306 return lang(key, (String[]) null);
309 public static String lang(String key, String s1) {
310 return lang(key, new String[] { s1 });
313 public static String lang(String key, String s1, String s2) {
314 return lang(key, new String[] { s1, s2 });
317 public static String lang(String key, String s1, String s2, String s3) {
318 return lang(key, new String[] { s1, s2, s3 });
321 public static String menuTitle(String key) {
322 String translation = null;
324 if (Globals.messages != null) {
325 translation = Globals.menuTitles.getString(key.replaceAll(" ", "_"));
327 } catch (MissingResourceException ex) {
330 if ((translation != null) && (translation.length() != 0)) {
331 return translation.replaceAll("_", " ");
337 public static String getIntegrityMessage(String key) {
338 String translation = null;
340 if (Globals.intMessages != null) {
341 translation = Globals.intMessages.getString(key);
343 } catch (MissingResourceException ex) {
346 // System.err.println("Warning: could not get menu item translation
350 if ((translation != null) && (translation.length() != 0)) {
357 // ============================================================
358 // Using the hashmap of entry types found in BibtexEntryType
359 // ============================================================
360 public static BibtexEntryType getEntryType(String type) {
361 // decide which entryType object to return
362 Object o = BibtexEntryType.ALL_TYPES.get(type);
364 return (BibtexEntryType) o;
366 return BibtexEntryType.OTHER;
369 * if(type.equals("article")) return BibtexEntryType.ARTICLE; else
370 * if(type.equals("book")) return BibtexEntryType.BOOK; else
371 * if(type.equals("inproceedings")) return
372 * BibtexEntryType.INPROCEEDINGS;
377 * Will return the names of multiple files selected in the given directory
378 * and the given extensions.
380 * Will return an empty String array if no entry is found.
385 * @param updateWorkingdirectory
386 * @return an array of selected file paths, or an empty array if no selection is made.
388 public static String[] getMultipleFiles(JFrame owner, File directory, String extension,
389 boolean updateWorkingdirectory) {
391 OpenFileFilter off = null;
392 if (extension == null)
393 off = new OpenFileFilter();
394 else if (!extension.equals(NONE))
395 off = new OpenFileFilter(extension);
397 Object files = getNewFileImpl(owner, directory, extension, null, off,
398 JFileChooser.OPEN_DIALOG, updateWorkingdirectory, false, true, null);
400 if (files instanceof String[]) {
401 return (String[]) files;
404 // http://sourceforge.net/tracker/index.php?func=detail&aid=1538769&group_id=92314&atid=600306
406 return new String[] { (String) files };
408 return new String[0];
411 public static String getNewFile(JFrame owner, File directory, String extension, int dialogType,
412 boolean updateWorkingDirectory) {
413 return getNewFile(owner, directory, extension, null, dialogType, updateWorkingDirectory,
417 public static String getNewFile(JFrame owner, File directory, String extension, int dialogType,
418 boolean updateWorkingDirectory, JComponent accessory) {
419 return getNewFile(owner, directory, extension, null, dialogType, updateWorkingDirectory,
424 public static String getNewFile(JFrame owner, File directory, String extension,
425 String description, int dialogType, boolean updateWorkingDirectory) {
426 return getNewFile(owner, directory, extension, description, dialogType,
427 updateWorkingDirectory, false, null);
430 public static String getNewDir(JFrame owner, File directory, String extension, int dialogType,
431 boolean updateWorkingDirectory) {
432 return getNewFile(owner, directory, extension, null, dialogType, updateWorkingDirectory,
436 public static String getNewDir(JFrame owner, File directory, String extension,
437 String description, int dialogType, boolean updateWorkingDirectory) {
438 return getNewFile(owner, directory, extension, description, dialogType,
439 updateWorkingDirectory, true, null);
442 private static String getNewFile(JFrame owner, File directory, String extension,
443 String description, int dialogType, boolean updateWorkingDirectory, boolean dirOnly,
444 JComponent accessory) {
446 OpenFileFilter off = null;
448 if (extension == null)
449 off = new OpenFileFilter();
450 else if (!extension.equals(NONE))
451 off = new OpenFileFilter(extension);
453 return (String) getNewFileImpl(owner, directory, extension, description, off, dialogType,
454 updateWorkingDirectory, dirOnly, false, accessory);
457 private static Object getNewFileImpl(JFrame owner, File directory, String extension,
458 String description, OpenFileFilter off, int dialogType, boolean updateWorkingDirectory,
459 boolean dirOnly, boolean multipleSelection, JComponent accessory) {
461 // Added the !dirOnly condition below as a workaround to the native file dialog
462 // not supporting directory selection:
463 if (!dirOnly && prefs.getBoolean("useNativeFileDialogOnMac")) {
465 return getNewFileForMac(owner, directory, extension, dialogType,
466 updateWorkingDirectory, dirOnly, off);
471 fc = new JFileChooser(directory);//JabRefFileChooser(directory);
472 if (accessory != null)
473 fc.setAccessory(accessory);
474 } catch (InternalError errl) {
475 // This try/catch clause was added because a user reported an
476 // InternalError getting thrown on WinNT, presumably because of a
477 // bug in JGoodies Windows PLAF. This clause can be removed if the
478 // bug is fixed, but for now we just resort to the native file
479 // dialog, using the same method as is always used on Mac:
480 return getNewFileForMac(owner, directory, extension, dialogType,
481 updateWorkingDirectory, dirOnly, off);
485 fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
489 fc.setMultiSelectionEnabled(multipleSelection);
491 fc.addChoosableFileFilter(off);
492 fc.setDialogType(dialogType);
494 if (dialogType == JFileChooser.OPEN_DIALOG) {
495 dialogResult = fc.showOpenDialog(owner);
496 } else if (dialogType == JFileChooser.SAVE_DIALOG) {
497 dialogResult = fc.showSaveDialog(owner);
499 dialogResult = fc.showDialog(owner, description);
502 // the getSelectedFile method returns a valid fileselection
503 // (if something is selected) indepentently from dialog return status
504 if (dialogResult != JFileChooser.APPROVE_OPTION)
508 File selectedFile = fc.getSelectedFile();
509 if (selectedFile == null) { // cancel
513 // If this is a save dialog, and the user has not chosen "All files" as
515 // we enforce the given extension. But only if extension is not null.
516 if ((extension != null) && (dialogType == JFileChooser.SAVE_DIALOG)
517 && (fc.getFileFilter() == off) && !off.accept(selectedFile)) {
519 // add the first extension if there are multiple extensions
520 selectedFile = new File(selectedFile.getPath() + extension.split("[, ]+", 0)[0]);
523 if (updateWorkingDirectory) {
524 prefs.put("workingDirectory", selectedFile.getPath());
527 if (!multipleSelection)
528 return selectedFile.getAbsolutePath();
530 File[] files = fc.getSelectedFiles();
531 String[] filenames = new String[files.length];
532 for (int i = 0; i < files.length; i++)
533 filenames[i] = files[i].getAbsolutePath();
538 private static String getNewFileForMac(JFrame owner, File directory, String extensions,
539 int dialogType, boolean updateWorkingDirectory, boolean dirOnly, FilenameFilter filter) {
541 FileDialog fc = new FileDialog(owner);
543 // fc.setFilenameFilter(filter);
544 if (directory != null) {
545 fc.setDirectory(directory.getParent());
547 if (dialogType == JFileChooser.OPEN_DIALOG) {
548 fc.setMode(FileDialog.LOAD);
550 fc.setMode(FileDialog.SAVE);
553 fc.setVisible(true); // fc.show(); -> deprecated since 1.5
555 if (fc.getFile() != null) {
556 Globals.prefs.put("workingDirectory", fc.getDirectory() + fc.getFile());
557 return fc.getDirectory() + fc.getFile();
563 public static String SPECIAL_COMMAND_CHARS = "\"`^~'c";
565 public static HashMap<String, String> HTML_CHARS = new HashMap<String, String>(), HTMLCHARS = new HashMap<String, String>(),
566 XML_CHARS = new HashMap<String, String>(), ASCII2XML_CHARS = new HashMap<String, String>(), UNICODE_CHARS = new HashMap<String, String>(),
567 RTFCHARS = new HashMap<String, String>(), URL_CHARS = new HashMap<String,String>();
571 // System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish
573 // System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish
574 // Biology", false));
575 // System.out.println(journalAbbrev.getFullName("Aquaculture Eng."));
577 * for (Iterator i=journalAbbrev.fullNameIterator(); i.hasNext();) {
578 * String s = (String)i.next();
579 * System.out.println(journalAbbrev.getFullName(s)+" :
580 * "+journalAbbrev.getAbbreviatedName(s, true)); }
583 // Start the thread that monitors file time stamps.
584 // Util.pr("Starting FileUpdateMonitor thread. Globals line 293.");
585 fileUpdateMonitor.start();
588 SHORTCUT_MASK = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
589 } catch (Throwable t) {
593 // Special characters in URLs need to be replaced to ensure that the URL
594 // opens properly on all platforms:
595 URL_CHARS.put("<", "%3c");
596 URL_CHARS.put(">", "%3e");
597 URL_CHARS.put("(", "%28");
598 URL_CHARS.put(")", "%29");
599 URL_CHARS.put(" ", "%20");
600 URL_CHARS.put("&", "%26");
601 URL_CHARS.put("$", "%24");
603 // HTMLCHARS.put("\"a", "ä");
604 // HTMLCHARS.put("\"A", "Ä");
605 // HTMLCHARS.put("\"e", "ë");
606 // HTMLCHARS.put("\"E", "Ë");
607 // HTMLCHARS.put("\"i", "ï");
608 // HTMLCHARS.put("\"I", "Ï");
609 // HTMLCHARS.put("\"o", "ö");
610 // HTMLCHARS.put("\"O", "Ö");
611 // HTMLCHARS.put("\"u", "ü");
612 // HTMLCHARS.put("\"U", "Ü");
613 // HTMLCHARS.put("`a", "à");
614 // HTMLCHARS.put("`A", "À");
615 // HTMLCHARS.put("`e", "è");
616 // HTMLCHARS.put("`E", "È");
617 // HTMLCHARS.put("`i", "ì");
618 // HTMLCHARS.put("`I", "Ì");
619 // HTMLCHARS.put("`o", "ò");
620 // HTMLCHARS.put("`O", "Ò");
621 // HTMLCHARS.put("`u", "ù");
622 // HTMLCHARS.put("`U", "Ù");
623 // HTMLCHARS.put("'e", "é");
624 // HTMLCHARS.put("'E", "É");
625 // HTMLCHARS.put("'i", "í");
626 // HTMLCHARS.put("'I", "Í");
627 // HTMLCHARS.put("'o", "ó");
628 // HTMLCHARS.put("'O", "Ó");
629 // HTMLCHARS.put("'u", "ú");
630 // HTMLCHARS.put("'U", "Ú");
631 // HTMLCHARS.put("'a", "á");
632 // HTMLCHARS.put("'A", "Á");
633 // HTMLCHARS.put("^a", "ô");
634 // HTMLCHARS.put("^A", "Ô");
635 // HTMLCHARS.put("^o", "ô");
636 // HTMLCHARS.put("^O", "Ô");
637 // HTMLCHARS.put("^u", "û");
638 // HTMLCHARS.put("^U", "Û");
639 // HTMLCHARS.put("^e", "ê");
640 // HTMLCHARS.put("^E", "Ê");
641 // HTMLCHARS.put("^i", "î");
642 // HTMLCHARS.put("^I", "Î");
643 // HTMLCHARS.put("~o", "õ");
644 // HTMLCHARS.put("~O", "Õ");
645 // HTMLCHARS.put("~n", "ñ");
646 // HTMLCHARS.put("~N", "Ñ");
647 // HTMLCHARS.put("~a", "ã");
648 // HTMLCHARS.put("~A", "Ã");
649 // HTMLCHARS.put("cc", "ç");
650 // HTMLCHARS.put("cC", "Ç");
652 // Following character definitions contributed by Ervin Kolenovic:
653 // HTML named entities from #192 - #255 (UNICODE Latin-1)
654 HTMLCHARS.put("`A", "À"); // #192
655 HTMLCHARS.put("'A", "Á"); // #193
656 HTMLCHARS.put("^A", "Â"); // #194
657 HTMLCHARS.put("~A", "Ã"); // #195
658 HTMLCHARS.put("\"A", "Ä"); // #196
659 HTMLCHARS.put("AA", "Å"); // #197
660 HTMLCHARS.put("AE", "Æ"); // #198
661 HTMLCHARS.put("cC", "Ç"); // #199
662 HTMLCHARS.put("`E", "È"); // #200
663 HTMLCHARS.put("'E", "É"); // #201
664 HTMLCHARS.put("^E", "Ê"); // #202
665 HTMLCHARS.put("\"E", "Ë"); // #203
666 HTMLCHARS.put("`I", "Ì"); // #204
667 HTMLCHARS.put("'I", "Í"); // #205
668 HTMLCHARS.put("^I", "Î"); // #206
669 HTMLCHARS.put("\"I", "Ï"); // #207
670 HTMLCHARS.put("DH", "Ð"); // #208
671 HTMLCHARS.put("~N", "Ñ"); // #209
672 HTMLCHARS.put("`O", "Ò"); // #210
673 HTMLCHARS.put("'O", "Ó"); // #211
674 HTMLCHARS.put("^O", "Ô"); // #212
675 HTMLCHARS.put("~O", "Õ"); // #213
676 HTMLCHARS.put("\"O", "Ö"); // #214
677 // According to ISO 8859-1 the "\times" symbol should be placed here
679 // Omitting this, because it is a mathematical symbol.
680 HTMLCHARS.put("O", "Ø"); // #216
681 HTMLCHARS.put("`U", "Ù"); // #217
682 HTMLCHARS.put("'U", "Ú"); // #218
683 HTMLCHARS.put("^U", "Û"); // #219
684 HTMLCHARS.put("\"U", "Ü"); // #220
685 HTMLCHARS.put("'Y", "Ý"); // #221
686 HTMLCHARS.put("TH", "Þ"); // #222
687 HTMLCHARS.put("ss", "ß"); // #223
688 HTMLCHARS.put("`a", "à"); // #224
689 HTMLCHARS.put("'a", "á"); // #225
690 HTMLCHARS.put("^a", "â"); // #226
691 HTMLCHARS.put("~a", "ã"); // #227
692 HTMLCHARS.put("\"a", "ä"); // #228
693 HTMLCHARS.put("aa", "å"); // #229
694 HTMLCHARS.put("ae", "æ"); // #230
695 HTMLCHARS.put("cc", "ç"); // #231
696 HTMLCHARS.put("`e", "è"); // #232
697 HTMLCHARS.put("'e", "é"); // #233
698 HTMLCHARS.put("^e", "ê"); // #234
699 HTMLCHARS.put("\"e", "ë"); // #235
700 HTMLCHARS.put("`i", "ì"); // #236
701 HTMLCHARS.put("'i", "í"); // #237
702 HTMLCHARS.put("^i", "î"); // #238
703 HTMLCHARS.put("\"i", "ï"); // #239
704 HTMLCHARS.put("dh", "ð"); // #240
705 HTMLCHARS.put("~n", "ñ"); // #241
706 HTMLCHARS.put("`o", "ò"); // #242
707 HTMLCHARS.put("'o", "ó"); // #243
708 HTMLCHARS.put("^o", "ô"); // #244
709 HTMLCHARS.put("~o", "õ"); // #245
710 HTMLCHARS.put("\"o", "ö"); // #246
711 // According to ISO 8859-1 the "\div" symbol should be placed here
713 // Omitting this, because it is a mathematical symbol.
714 HTMLCHARS.put("o", "ø"); // #248
715 HTMLCHARS.put("`u", "ù"); // #249
716 HTMLCHARS.put("'u", "ú"); // #250
717 HTMLCHARS.put("^u", "û"); // #251
718 HTMLCHARS.put("\"u", "ü"); // #252
719 HTMLCHARS.put("'y", "ý"); // #253
720 HTMLCHARS.put("th", "þ"); // #254
721 HTMLCHARS.put("\"y", "ÿ"); // #255
723 // HTML special characters without names (UNICODE Latin Extended-A),
724 // indicated by UNICODE number
725 HTMLCHARS.put("=A", "Ā"); // "Amacr"
726 HTMLCHARS.put("=a", "ā"); // "amacr"
727 HTMLCHARS.put("uA", "Ă"); // "Abreve"
728 HTMLCHARS.put("ua", "ă"); // "abreve"
729 HTMLCHARS.put("kA", "Ą"); // "Aogon"
730 HTMLCHARS.put("ka", "ą"); // "aogon"
731 HTMLCHARS.put("'C", "Ć"); // "Cacute"
732 HTMLCHARS.put("'c", "ć"); // "cacute"
733 HTMLCHARS.put("^C", "Ĉ"); // "Ccirc"
734 HTMLCHARS.put("^c", "ĉ"); // "ccirc"
735 HTMLCHARS.put(".C", "Ċ"); // "Cdot"
736 HTMLCHARS.put(".c", "ċ"); // "cdot"
737 HTMLCHARS.put("vC", "Č"); // "Ccaron"
738 HTMLCHARS.put("vc", "č"); // "ccaron"
739 HTMLCHARS.put("vD", "Ď"); // "Dcaron"
740 // Symbol #271 (d�) has no special Latex command
741 HTMLCHARS.put("DJ", "Đ"); // "Dstrok"
742 HTMLCHARS.put("dj", "đ"); // "dstrok"
743 HTMLCHARS.put("=E", "Ē"); // "Emacr"
744 HTMLCHARS.put("=e", "ē"); // "emacr"
745 HTMLCHARS.put("uE", "Ĕ"); // "Ebreve"
746 HTMLCHARS.put("ue", "ĕ"); // "ebreve"
747 HTMLCHARS.put(".E", "Ė"); // "Edot"
748 HTMLCHARS.put(".e", "ė"); // "edot"
749 HTMLCHARS.put("kE", "Ę"); // "Eogon"
750 HTMLCHARS.put("ke", "ę"); // "eogon"
751 HTMLCHARS.put("vE", "Ě"); // "Ecaron"
752 HTMLCHARS.put("ve", "ě"); // "ecaron"
753 HTMLCHARS.put("^G", "Ĝ"); // "Gcirc"
754 HTMLCHARS.put("^g", "ĝ"); // "gcirc"
755 HTMLCHARS.put("uG", "Ğ"); // "Gbreve"
756 HTMLCHARS.put("ug", "ğ"); // "gbreve"
757 HTMLCHARS.put(".G", "Ġ"); // "Gdot"
758 HTMLCHARS.put(".g", "ġ"); // "gdot"
759 HTMLCHARS.put("cG", "Ģ"); // "Gcedil"
760 HTMLCHARS.put("'g", "ģ"); // "gacute"
761 HTMLCHARS.put("^H", "Ĥ"); // "Hcirc"
762 HTMLCHARS.put("^h", "ĥ"); // "hcirc"
763 HTMLCHARS.put("Hstrok", "Ħ"); // "Hstrok"
764 HTMLCHARS.put("hstrok", "ħ"); // "hstrok"
765 HTMLCHARS.put("~I", "Ĩ"); // "Itilde"
766 HTMLCHARS.put("~i", "ĩ"); // "itilde"
767 HTMLCHARS.put("=I", "Ī"); // "Imacr"
768 HTMLCHARS.put("=i", "ī"); // "imacr"
769 HTMLCHARS.put("uI", "Ĭ"); // "Ibreve"
770 HTMLCHARS.put("ui", "ĭ"); // "ibreve"
771 HTMLCHARS.put("kI", "Į"); // "Iogon"
772 HTMLCHARS.put("ki", "į"); // "iogon"
773 HTMLCHARS.put(".I", "İ"); // "Idot"
774 HTMLCHARS.put("i", "ı"); // "inodot"
775 // Symbol #306 (IJ) has no special Latex command
776 // Symbol #307 (ij) has no special Latex command
777 HTMLCHARS.put("^J", "Ĵ"); // "Jcirc"
778 HTMLCHARS.put("^j", "ĵ"); // "jcirc"
779 HTMLCHARS.put("cK", "Ķ"); // "Kcedil"
780 HTMLCHARS.put("ck", "ķ"); // "kcedil"
781 // Symbol #312 (k) has no special Latex command
782 HTMLCHARS.put("'L", "Ĺ"); // "Lacute"
783 HTMLCHARS.put("'l", "ĺ"); // "lacute"
784 HTMLCHARS.put("cL", "Ļ"); // "Lcedil"
785 HTMLCHARS.put("cl", "ļ"); // "lcedil"
786 // Symbol #317 (L�) has no special Latex command
787 // Symbol #318 (l�) has no special Latex command
788 HTMLCHARS.put("Lmidot", "Ŀ"); // "Lmidot"
789 HTMLCHARS.put("lmidot", "ŀ"); // "lmidot"
790 HTMLCHARS.put("L", "Ł"); // "Lstrok"
791 HTMLCHARS.put("l", "ł"); // "lstrok"
792 HTMLCHARS.put("'N", "Ń"); // "Nacute"
793 HTMLCHARS.put("'n", "ń"); // "nacute"
794 HTMLCHARS.put("cN", "Ņ"); // "Ncedil"
795 HTMLCHARS.put("cn", "ņ"); // "ncedil"
796 HTMLCHARS.put("vN", "Ň"); // "Ncaron"
797 HTMLCHARS.put("vn", "ň"); // "ncaron"
798 // Symbol #329 (�n) has no special Latex command
799 HTMLCHARS.put("NG", "Ŋ"); // "ENG"
800 HTMLCHARS.put("ng", "ŋ"); // "eng"
801 HTMLCHARS.put("=O", "Ō"); // "Omacr"
802 HTMLCHARS.put("=o", "ō"); // "omacr"
803 HTMLCHARS.put("uO", "Ŏ"); // "Obreve"
804 HTMLCHARS.put("uo", "ŏ"); // "obreve"
805 HTMLCHARS.put("HO", "Ő"); // "Odblac"
806 HTMLCHARS.put("Ho", "ő"); // "odblac"
807 HTMLCHARS.put("OE", "Œ"); // "OElig"
808 HTMLCHARS.put("oe", "œ"); // "oelig"
809 HTMLCHARS.put("'R", "Ŕ"); // "Racute"
810 HTMLCHARS.put("'r", "ŕ"); // "racute"
811 HTMLCHARS.put("cR", "Ŗ"); // "Rcedil"
812 HTMLCHARS.put("cr", "ŗ"); // "rcedil"
813 HTMLCHARS.put("vR", "Ř"); // "Rcaron"
814 HTMLCHARS.put("vr", "ř"); // "rcaron"
815 HTMLCHARS.put("'S", "Ś"); // "Sacute"
816 HTMLCHARS.put("'s", "ś"); // "sacute"
817 HTMLCHARS.put("^S", "Ŝ"); // "Scirc"
818 HTMLCHARS.put("^s", "ŝ"); // "scirc"
819 HTMLCHARS.put("cS", "Ş"); // "Scedil"
820 HTMLCHARS.put("cs", "ş"); // "scedil"
821 HTMLCHARS.put("vS", "Š"); // "Scaron"
822 HTMLCHARS.put("vs", "š"); // "scaron"
823 HTMLCHARS.put("cT", "Ţ"); // "Tcedil"
824 HTMLCHARS.put("ct", "ţ"); // "tcedil"
825 HTMLCHARS.put("vT", "Ť"); // "Tcaron"
826 // Symbol #357 (t�) has no special Latex command
827 HTMLCHARS.put("Tstrok", "Ŧ"); // "Tstrok"
828 HTMLCHARS.put("tstrok", "ŧ"); // "tstrok"
829 HTMLCHARS.put("~U", "Ũ"); // "Utilde"
830 HTMLCHARS.put("~u", "ũ"); // "utilde"
831 HTMLCHARS.put("=U", "Ū"); // "Umacr"
832 HTMLCHARS.put("=u", "ū"); // "umacr"
833 HTMLCHARS.put("uU", "Ŭ"); // "Ubreve"
834 HTMLCHARS.put("uu", "ŭ"); // "ubreve"
835 HTMLCHARS.put("rU", "Ů"); // "Uring"
836 HTMLCHARS.put("ru", "ů"); // "uring"
837 HTMLCHARS.put("HU", "Ű"); // "Odblac"
838 HTMLCHARS.put("Hu", "ű"); // "odblac"
839 HTMLCHARS.put("kU", "Ų"); // "Uogon"
840 HTMLCHARS.put("ku", "ų"); // "uogon"
841 HTMLCHARS.put("^W", "Ŵ"); // "Wcirc"
842 HTMLCHARS.put("^w", "ŵ"); // "wcirc"
843 HTMLCHARS.put("^Y", "Ŷ"); // "Ycirc"
844 HTMLCHARS.put("^y", "ŷ"); // "ycirc"
845 HTMLCHARS.put("\"Y", "Ÿ"); // "Yuml"
846 HTMLCHARS.put("'Z", "Ź"); // "Zacute"
847 HTMLCHARS.put("'z", "ź"); // "zacute"
848 HTMLCHARS.put(".Z", "Ż"); // "Zdot"
849 HTMLCHARS.put(".z", "ż"); // "zdot"
850 HTMLCHARS.put("vZ", "Ž"); // "Zcaron"
851 HTMLCHARS.put("vz", "ž"); // "zcaron"
852 // Symbol #383 (f) has no special Latex command
853 HTMLCHARS.put("%", "%"); // percent sign
855 XML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "ä");
856 XML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "Ä");
857 XML_CHARS.put("\\{\\\\\\\"\\{e\\}\\}", "ë");
858 XML_CHARS.put("\\{\\\\\\\"\\{E\\}\\}", "Ë");
859 XML_CHARS.put("\\{\\\\\\\"\\{i\\}\\}", "ï");
860 XML_CHARS.put("\\{\\\\\\\"\\{I\\}\\}", "Ï");
861 XML_CHARS.put("\\{\\\\\\\"\\{o\\}\\}", "ö");
862 XML_CHARS.put("\\{\\\\\\\"\\{O\\}\\}", "Ö");
863 XML_CHARS.put("\\{\\\\\\\"\\{u\\}\\}", "ü");
864 XML_CHARS.put("\\{\\\\\\\"\\{U\\}\\}", "Ü");
866 XML_CHARS.put("\\{\\\\\\`\\{e\\}\\}", "è");
867 XML_CHARS.put("\\{\\\\\\`\\{E\\}\\}", "È");
868 XML_CHARS.put("\\{\\\\\\`\\{i\\}\\}", "ì");
869 XML_CHARS.put("\\{\\\\\\`\\{I\\}\\}", "Ì");
870 XML_CHARS.put("\\{\\\\\\`\\{o\\}\\}", "ò");
871 XML_CHARS.put("\\{\\\\\\`\\{O\\}\\}", "Ò");
872 XML_CHARS.put("\\{\\\\\\`\\{u\\}\\}", "ù");
873 XML_CHARS.put("\\{\\\\\\`\\{U\\}\\}", "Ù");
874 XML_CHARS.put("\\{\\\\\\'\\{e\\}\\}", "é");
875 XML_CHARS.put("\\{\\\\\\\uFFFD\\{E\\}\\}", "É");
876 XML_CHARS.put("\\{\\\\\\\uFFFD\\{i\\}\\}", "í");
877 XML_CHARS.put("\\{\\\\\\\uFFFD\\{I\\}\\}", "Í");
878 XML_CHARS.put("\\{\\\\\\\uFFFD\\{o\\}\\}", "ó");
879 XML_CHARS.put("\\{\\\\\\\uFFFD\\{O\\}\\}", "Ó");
880 XML_CHARS.put("\\{\\\\\\\uFFFD\\{u\\}\\}", "ú");
881 XML_CHARS.put("\\{\\\\\\\uFFFD\\{U\\}\\}", "Ú");
882 XML_CHARS.put("\\{\\\\\\\uFFFD\\{a\\}\\}", "á");
883 XML_CHARS.put("\\{\\\\\\\uFFFD\\{A\\}\\}", "Á");
885 XML_CHARS.put("\\{\\\\\\^\\{o\\}\\}", "ô");
886 XML_CHARS.put("\\{\\\\\\^\\{O\\}\\}", "Ô");
887 XML_CHARS.put("\\{\\\\\\^\\{u\\}\\}", "ù");
888 XML_CHARS.put("\\{\\\\\\^\\{U\\}\\}", "Ù");
889 XML_CHARS.put("\\{\\\\\\^\\{e\\}\\}", "ê");
890 XML_CHARS.put("\\{\\\\\\^\\{E\\}\\}", "Ê");
891 XML_CHARS.put("\\{\\\\\\^\\{i\\}\\}", "î");
892 XML_CHARS.put("\\{\\\\\\^\\{I\\}\\}", "Î");
893 XML_CHARS.put("\\{\\\\\\~\\{o\\}\\}", "õ");
894 XML_CHARS.put("\\{\\\\\\~\\{O\\}\\}", "Õ");
895 XML_CHARS.put("\\{\\\\\\~\\{n\\}\\}", "ñ");
896 XML_CHARS.put("\\{\\\\\\~\\{N\\}\\}", "Ñ");
897 XML_CHARS.put("\\{\\\\\\~\\{a\\}\\}", "ã");
898 XML_CHARS.put("\\{\\\\\\~\\{A\\}\\}", "Ã");
900 XML_CHARS.put("\\{\\\\\\\"a\\}", "ä");
901 XML_CHARS.put("\\{\\\\\\\"A\\}", "Ä");
902 XML_CHARS.put("\\{\\\\\\\"e\\}", "ë");
903 XML_CHARS.put("\\{\\\\\\\"E\\}", "Ë");
904 XML_CHARS.put("\\{\\\\\\\"i\\}", "ï");
905 XML_CHARS.put("\\{\\\\\\\"I\\}", "Ï");
906 XML_CHARS.put("\\{\\\\\\\"o\\}", "ö");
907 XML_CHARS.put("\\{\\\\\\\"O\\}", "Ö");
908 XML_CHARS.put("\\{\\\\\\\"u\\}", "ü");
909 XML_CHARS.put("\\{\\\\\\\"U\\}", "Ü");
911 XML_CHARS.put("\\{\\\\\\`e\\}", "è");
912 XML_CHARS.put("\\{\\\\\\`E\\}", "È");
913 XML_CHARS.put("\\{\\\\\\`i\\}", "ì");
914 XML_CHARS.put("\\{\\\\\\`I\\}", "Ì");
915 XML_CHARS.put("\\{\\\\\\`o\\}", "ò");
916 XML_CHARS.put("\\{\\\\\\`O\\}", "Ò");
917 XML_CHARS.put("\\{\\\\\\`u\\}", "ù");
918 XML_CHARS.put("\\{\\\\\\`U\\}", "Ù");
919 XML_CHARS.put("\\{\\\\\\'e\\}", "é");
920 XML_CHARS.put("\\{\\\\\\'E\\}", "É");
921 XML_CHARS.put("\\{\\\\\\'i\\}", "í");
922 XML_CHARS.put("\\{\\\\\\'I\\}", "Í");
923 XML_CHARS.put("\\{\\\\\\'o\\}", "ó");
924 XML_CHARS.put("\\{\\\\\\'O\\}", "Ó");
925 XML_CHARS.put("\\{\\\\\\'u\\}", "ú");
926 XML_CHARS.put("\\{\\\\\\'U\\}", "Ú");
927 XML_CHARS.put("\\{\\\\\\'a\\}", "á");
928 XML_CHARS.put("\\{\\\\\\'A\\}", "Á");
930 XML_CHARS.put("\\{\\\\\\^a\\}", "ô");
931 XML_CHARS.put("\\{\\\\\\^A\\}", "Ô");
932 XML_CHARS.put("\\{\\\\\\^o\\}", "ô");
933 XML_CHARS.put("\\{\\\\\\^O\\}", "Ô");
934 XML_CHARS.put("\\{\\\\\\^u\\}", "ù");
935 XML_CHARS.put("\\{\\\\\\^U\\}", "Ù");
936 XML_CHARS.put("\\{\\\\\\^e\\}", "ê");
937 XML_CHARS.put("\\{\\\\\\^E\\}", "Ê");
938 XML_CHARS.put("\\{\\\\\\^i\\}", "î");
939 XML_CHARS.put("\\{\\\\\\^I\\}", "Î");
940 XML_CHARS.put("\\{\\\\\\~o\\}", "õ");
941 XML_CHARS.put("\\{\\\\\\~O\\}", "Õ");
942 XML_CHARS.put("\\{\\\\\\~n\\}", "ñ");
943 XML_CHARS.put("\\{\\\\\\~N\\}", "Ñ");
944 XML_CHARS.put("\\{\\\\\\~a\\}", "ã");
945 XML_CHARS.put("\\{\\\\\\~A\\}", "Ã");
947 ASCII2XML_CHARS.put("<", "<");
948 ASCII2XML_CHARS.put("\"", """);
949 ASCII2XML_CHARS.put(">", ">");
951 UNICODE_CHARS.put("\u00C0", "A");
952 UNICODE_CHARS.put("\u00C1", "A");
953 UNICODE_CHARS.put("\u00C2", "A");
954 UNICODE_CHARS.put("\u00C3", "A");
955 UNICODE_CHARS.put("\u00C4", "Ae");
956 UNICODE_CHARS.put("\u00C5", "Aa");
957 UNICODE_CHARS.put("\u00C6", "Ae");
958 UNICODE_CHARS.put("\u00C7", "C");
959 UNICODE_CHARS.put("\u00C8", "E");
960 UNICODE_CHARS.put("\u00C9", "E");
961 UNICODE_CHARS.put("\u00CA", "E");
962 UNICODE_CHARS.put("\u00CB", "E");
963 UNICODE_CHARS.put("\u00CC", "I");
964 UNICODE_CHARS.put("\u00CD", "I");
965 UNICODE_CHARS.put("\u00CE", "I");
966 UNICODE_CHARS.put("\u00CF", "I");
967 UNICODE_CHARS.put("\u00D0", "D");
968 UNICODE_CHARS.put("\u00D1", "N");
969 UNICODE_CHARS.put("\u00D2", "O");
970 UNICODE_CHARS.put("\u00D3", "O");
971 UNICODE_CHARS.put("\u00D4", "O");
972 UNICODE_CHARS.put("\u00D5", "O");
973 UNICODE_CHARS.put("\u00D6", "Oe");
974 UNICODE_CHARS.put("\u00D8", "Oe");
975 UNICODE_CHARS.put("\u00D9", "U");
976 UNICODE_CHARS.put("\u00DA", "U");
977 UNICODE_CHARS.put("\u00DB", "U");
978 UNICODE_CHARS.put("\u00DC", "Ue"); // U umlaut ..
979 UNICODE_CHARS.put("\u00DD", "Y");
980 UNICODE_CHARS.put("\u00DF", "ss");
981 UNICODE_CHARS.put("\u00E0", "a");
982 UNICODE_CHARS.put("\u00E1", "a");
983 UNICODE_CHARS.put("\u00E2", "a");
984 UNICODE_CHARS.put("\u00E3", "a");
985 UNICODE_CHARS.put("\u00E4", "ae");
986 UNICODE_CHARS.put("\u00E5", "aa");
987 UNICODE_CHARS.put("\u00E6", "ae");
988 UNICODE_CHARS.put("\u00E7", "c");
989 UNICODE_CHARS.put("\u00E8", "e");
990 UNICODE_CHARS.put("\u00E9", "e");
991 UNICODE_CHARS.put("\u00EA", "e");
992 UNICODE_CHARS.put("\u00EB", "e");
993 UNICODE_CHARS.put("\u00EC", "i");
994 UNICODE_CHARS.put("\u00ED", "i");
995 UNICODE_CHARS.put("\u00EE", "i");
996 UNICODE_CHARS.put("\u00EF", "i");
997 UNICODE_CHARS.put("\u00F0", "o");
998 UNICODE_CHARS.put("\u00F1", "n");
999 UNICODE_CHARS.put("\u00F2", "o");
1000 UNICODE_CHARS.put("\u00F3", "o");
1001 UNICODE_CHARS.put("\u00F4", "o");
1002 UNICODE_CHARS.put("\u00F5", "o");
1003 UNICODE_CHARS.put("\u00F6", "oe");
1004 UNICODE_CHARS.put("\u00F8", "oe");
1005 UNICODE_CHARS.put("\u00F9", "u");
1006 UNICODE_CHARS.put("\u00FA", "u");
1007 UNICODE_CHARS.put("\u00FB", "u");
1008 UNICODE_CHARS.put("\u00FC", "ue"); // u umlaut...
1009 UNICODE_CHARS.put("\u00FD", "y");
1010 UNICODE_CHARS.put("\u00FF", "y");
1011 UNICODE_CHARS.put("\u0100", "A");
1012 UNICODE_CHARS.put("\u0101", "a");
1013 UNICODE_CHARS.put("\u0102", "A");
1014 UNICODE_CHARS.put("\u0103", "a");
1015 UNICODE_CHARS.put("\u0104", "A");
1016 UNICODE_CHARS.put("\u0105", "a");
1017 UNICODE_CHARS.put("\u0106", "C");
1018 UNICODE_CHARS.put("\u0107", "c");
1019 UNICODE_CHARS.put("\u0108", "C");
1020 UNICODE_CHARS.put("\u0109", "c");
1021 UNICODE_CHARS.put("\u010A", "C");
1022 UNICODE_CHARS.put("\u010B", "c");
1023 UNICODE_CHARS.put("\u010C", "C");
1024 UNICODE_CHARS.put("\u010D", "c");
1025 UNICODE_CHARS.put("\u010E", "D");
1026 UNICODE_CHARS.put("\u010F", "d");
1027 UNICODE_CHARS.put("\u0110", "D");
1028 UNICODE_CHARS.put("\u0111", "d");
1029 UNICODE_CHARS.put("\u0112", "E");
1030 UNICODE_CHARS.put("\u0113", "e");
1031 UNICODE_CHARS.put("\u0114", "E");
1032 UNICODE_CHARS.put("\u0115", "e");
1033 UNICODE_CHARS.put("\u0116", "E");
1034 UNICODE_CHARS.put("\u0117", "e");
1035 UNICODE_CHARS.put("\u0118", "E");
1036 UNICODE_CHARS.put("\u0119", "e");
1037 UNICODE_CHARS.put("\u011A", "E");
1038 UNICODE_CHARS.put("\u011B", "e");
1039 UNICODE_CHARS.put("\u011C", "G");
1040 UNICODE_CHARS.put("\u011D", "g");
1041 UNICODE_CHARS.put("\u011E", "G");
1042 UNICODE_CHARS.put("\u011F", "g");
1043 UNICODE_CHARS.put("\u0120", "G");
1044 UNICODE_CHARS.put("\u0121", "g");
1045 UNICODE_CHARS.put("\u0122", "G");
1046 UNICODE_CHARS.put("\u0123", "g");
1047 UNICODE_CHARS.put("\u0124", "H");
1048 UNICODE_CHARS.put("\u0125", "h");
1049 UNICODE_CHARS.put("\u0127", "h");
1050 UNICODE_CHARS.put("\u0128", "I");
1051 UNICODE_CHARS.put("\u0129", "i");
1052 UNICODE_CHARS.put("\u012A", "I");
1053 UNICODE_CHARS.put("\u012B", "i");
1054 UNICODE_CHARS.put("\u012C", "I");
1055 UNICODE_CHARS.put("\u012D", "i");
1056 // UNICODE_CHARS.put("\u0100", "");
1058 RTFCHARS.put("`a", "\\'e0");
1059 RTFCHARS.put("`e", "\\'e8");
1060 RTFCHARS.put("`i", "\\'ec");
1061 RTFCHARS.put("`o", "\\'f2");
1062 RTFCHARS.put("`u", "\\'f9");
1063 RTFCHARS.put("?a", "\\'e1");
1064 RTFCHARS.put("?e", "\\'e9");
1065 RTFCHARS.put("?i", "\\'ed");
1066 RTFCHARS.put("?o", "\\'f3");
1067 RTFCHARS.put("?u", "\\'fa");
1068 RTFCHARS.put("^a", "\\'e2");
1069 RTFCHARS.put("^e", "\\'ea");
1070 RTFCHARS.put("^i", "\\'ee");
1071 RTFCHARS.put("^o", "\\'f4");
1072 RTFCHARS.put("^u", "\\'fa");
1073 RTFCHARS.put("\"a", "\\'e4");
1074 RTFCHARS.put("\"e", "\\'eb");
1075 RTFCHARS.put("\"i", "\\'ef");
1076 RTFCHARS.put("\"o", "\\'f6");
1077 RTFCHARS.put("\"u", "\\u252u");
1078 RTFCHARS.put("~n", "\\'f1");
1079 RTFCHARS.put("`A", "\\'c0");
1080 RTFCHARS.put("`E", "\\'c8");
1081 RTFCHARS.put("`I", "\\'cc");
1082 RTFCHARS.put("`O", "\\'d2");
1083 RTFCHARS.put("`U", "\\'d9");
1084 RTFCHARS.put("?A", "\\'c1");
1085 RTFCHARS.put("?E", "\\'c9");
1086 RTFCHARS.put("?I", "\\'cd");
1087 RTFCHARS.put("?O", "\\'d3");
1088 RTFCHARS.put("?U", "\\'da");
1089 RTFCHARS.put("^A", "\\'c2");
1090 RTFCHARS.put("^E", "\\'ca");
1091 RTFCHARS.put("^I", "\\'ce");
1092 RTFCHARS.put("^O", "\\'d4");
1093 RTFCHARS.put("^U", "\\'db");
1094 RTFCHARS.put("\"A", "\\'c4");
1095 RTFCHARS.put("\"E", "\\'cb");
1096 RTFCHARS.put("\"I", "\\'cf");
1097 RTFCHARS.put("\"O", "\\'d6");
1098 RTFCHARS.put("\"U", "\\'dc");
1100 // Use UNICODE characters for RTF-Chars which can not be found in the
1101 // standard codepage
1103 // RTFCHARS.put("`A", "\\u192"); // "Agrave" exists in standard
1105 RTFCHARS.put("'A", "\\u193A"); // "Aacute"
1106 // RTFCHARS.put("^A", "\\u194"); // "Acirc" exists in standard
1108 RTFCHARS.put("~A", "\\u195A"); // "Atilde"
1109 // RTFCHARS.put("\"A", "\\u196"); // "Auml" exists in standard
1111 RTFCHARS.put("AA", "\\u197A"); // "Aring"
1112 RTFCHARS.put("AE", "{\\uc2\\u198AE}"); // "AElig"
1113 RTFCHARS.put("cC", "\\u199C"); // "Ccedil"
1114 // RTFCHARS.put("`E", "\\u200"); // "Egrave" exists in standard
1116 RTFCHARS.put("'E", "\\u201E"); // "Eacute"
1117 // RTFCHARS.put("^E", "\\u202"); // "Ecirc" exists in standard
1119 // RTFCHARS.put("\"E", "\\u203"); // "Euml" exists in standard
1121 // RTFCHARS.put("`I", "\\u204"); // "Igrave" exists in standard
1123 RTFCHARS.put("'I", "\\u205I"); // "Iacute"
1124 // RTFCHARS.put("^I", "\\u206"); // "Icirc" exists in standard
1126 // RTFCHARS.put("\"I", "\\u207"); // "Iuml" exists in standard
1128 RTFCHARS.put("DH", "\\u208D"); // "ETH"
1129 RTFCHARS.put("~N", "\\u209N"); // "Ntilde"
1130 // RTFCHARS.put("`O", "\\u210"); // "Ograve" exists in standard
1132 RTFCHARS.put("'O", "\\u211O"); // "Oacute"
1133 // RTFCHARS.put("^O", "\\u212"); // "Ocirc" exists in standard
1135 RTFCHARS.put("~O", "\\u213O"); // "Otilde"
1136 // RTFCHARS.put("\"O", "\\u214"); // "Ouml" exists in standard
1138 // According to ISO 8859-1 the "\times" symbol should be placed here
1140 // Omitting this, because it is a mathematical symbol.
1141 RTFCHARS.put("O", "\\u216O"); // "Oslash"
1142 // RTFCHARS.put("`U", "\\u217"); // "Ugrave" exists in standard
1144 RTFCHARS.put("'U", "\\u218U"); // "Uacute"
1145 // RTFCHARS.put("^U", "\\u219"); // "Ucirc" exists in standard
1147 // RTFCHARS.put("\"U", "\\u220"); // "Uuml" exists in standard
1149 RTFCHARS.put("'Y", "\\u221Y"); // "Yacute"
1150 RTFCHARS.put("TH", "{\\uc2\\u222TH}"); // "THORN"
1151 RTFCHARS.put("ss", "{\\uc2\\u223ss}"); // "szlig"
1152 //RTFCHARS.put("ss", "AFFEN"); // "szlig"
1153 // RTFCHARS.put("`a", "\\u224"); // "agrave" exists in standard
1155 RTFCHARS.put("'a", "\\u225a"); // "aacute"
1156 // RTFCHARS.put("^a", "\\u226"); // "acirc" exists in standard
1158 RTFCHARS.put("~a", "\\u227a"); // "atilde"
1159 // RTFCHARS.put("\"a", "\\u228"); // "auml" exists in standard
1161 RTFCHARS.put("aa", "\\u229a"); // "aring"
1162 RTFCHARS.put("ae", "{\\uc2\\u230ae}"); // "aelig"
1163 RTFCHARS.put("cc", "\\u231c"); // "ccedil"
1164 // RTFCHARS.put("`e", "\\u232"); // "egrave" exists in standard
1166 RTFCHARS.put("'e", "\\u233e"); // "eacute"
1167 // RTFCHARS.put("^e", "\\u234"); // "ecirc" exists in standard
1169 // RTFCHARS.put("\"e", "\\u235"); // "euml" exists in standard
1171 // RTFCHARS.put("`i", "\\u236"); // "igrave" exists in standard
1173 RTFCHARS.put("'i", "\\u237i"); // "iacute"
1174 // RTFCHARS.put("^i", "\\u238"); // "icirc" exists in standard
1176 // RTFCHARS.put("\"i", "\\u239"); // "iuml" exists in standard
1178 RTFCHARS.put("dh", "\\u240d"); // "eth"
1179 // RTFCHARS.put("~n", "\\u241"); // "ntilde" exists in standard
1181 // RTFCHARS.put("`o", "\\u242"); // "ograve" exists in standard
1183 RTFCHARS.put("'o", "\\u243o"); // "oacute"
1184 // RTFCHARS.put("^o", "\\u244"); // "ocirc" exists in standard
1186 RTFCHARS.put("~o", "\\u245o"); // "otilde"
1187 // RTFCHARS.put("\"o", "\\u246"); // "ouml" exists in standard
1189 // According to ISO 8859-1 the "\div" symbol should be placed here
1191 // Omitting this, because it is a mathematical symbol.
1192 RTFCHARS.put("o", "\\u248o"); // "oslash"
1193 // RTFCHARS.put("`u", "\\u249"); // "ugrave" exists in standard
1195 RTFCHARS.put("'u", "\\u250u"); // "uacute"
1196 // RTFCHARS.put("^u", "\\u251"); // "ucirc" exists in standard
1198 // RTFCHARS.put("\"u", "\\u252"); // "uuml" exists in standard
1200 RTFCHARS.put("'y", "\\u253y"); // "yacute"
1201 RTFCHARS.put("th", "{\\uc2\\u254th}"); // "thorn"
1202 RTFCHARS.put("\"y", "\\u255y"); // "yuml"
1204 RTFCHARS.put("=A", "\\u256A"); // "Amacr"
1205 RTFCHARS.put("=a", "\\u257a"); // "amacr"
1206 RTFCHARS.put("uA", "\\u258A"); // "Abreve"
1207 RTFCHARS.put("ua", "\\u259a"); // "abreve"
1208 RTFCHARS.put("kA", "\\u260A"); // "Aogon"
1209 RTFCHARS.put("ka", "\\u261a"); // "aogon"
1210 RTFCHARS.put("'C", "\\u262C"); // "Cacute"
1211 RTFCHARS.put("'c", "\\u263c"); // "cacute"
1212 RTFCHARS.put("^C", "\\u264C"); // "Ccirc"
1213 RTFCHARS.put("^c", "\\u265c"); // "ccirc"
1214 RTFCHARS.put(".C", "\\u266C"); // "Cdot"
1215 RTFCHARS.put(".c", "\\u267c"); // "cdot"
1216 RTFCHARS.put("vC", "\\u268C"); // "Ccaron"
1217 RTFCHARS.put("vc", "\\u269c"); // "ccaron"
1218 RTFCHARS.put("vD", "\\u270D"); // "Dcaron"
1219 // Symbol #271 (d�) has no special Latex command
1220 RTFCHARS.put("DJ", "\\u272D"); // "Dstrok"
1221 RTFCHARS.put("dj", "\\u273d"); // "dstrok"
1222 RTFCHARS.put("=E", "\\u274E"); // "Emacr"
1223 RTFCHARS.put("=e", "\\u275e"); // "emacr"
1224 RTFCHARS.put("uE", "\\u276E"); // "Ebreve"
1225 RTFCHARS.put("ue", "\\u277e"); // "ebreve"
1226 RTFCHARS.put(".E", "\\u278E"); // "Edot"
1227 RTFCHARS.put(".e", "\\u279e"); // "edot"
1228 RTFCHARS.put("kE", "\\u280E"); // "Eogon"
1229 RTFCHARS.put("ke", "\\u281e"); // "eogon"
1230 RTFCHARS.put("vE", "\\u282E"); // "Ecaron"
1231 RTFCHARS.put("ve", "\\u283e"); // "ecaron"
1232 RTFCHARS.put("^G", "\\u284G"); // "Gcirc"
1233 RTFCHARS.put("^g", "\\u285g"); // "gcirc"
1234 RTFCHARS.put("uG", "\\u286G"); // "Gbreve"
1235 RTFCHARS.put("ug", "\\u287g"); // "gbreve"
1236 RTFCHARS.put(".G", "\\u288G"); // "Gdot"
1237 RTFCHARS.put(".g", "\\u289g"); // "gdot"
1238 RTFCHARS.put("cG", "\\u290G"); // "Gcedil"
1239 RTFCHARS.put("'g", "\\u291g"); // "gacute"
1240 RTFCHARS.put("^H", "\\u292H"); // "Hcirc"
1241 RTFCHARS.put("^h", "\\u293h"); // "hcirc"
1242 RTFCHARS.put("Hstrok", "\\u294H"); // "Hstrok"
1243 RTFCHARS.put("hstrok", "\\u295h"); // "hstrok"
1244 RTFCHARS.put("~I", "\\u296I"); // "Itilde"
1245 RTFCHARS.put("~i", "\\u297i"); // "itilde"
1246 RTFCHARS.put("=I", "\\u298I"); // "Imacr"
1247 RTFCHARS.put("=i", "\\u299i"); // "imacr"
1248 RTFCHARS.put("uI", "\\u300I"); // "Ibreve"
1249 RTFCHARS.put("ui", "\\u301i"); // "ibreve"
1250 RTFCHARS.put("kI", "\\u302I"); // "Iogon"
1251 RTFCHARS.put("ki", "\\u303i"); // "iogon"
1252 RTFCHARS.put(".I", "\\u304I"); // "Idot"
1253 RTFCHARS.put("i", "\\u305i"); // "inodot"
1254 // Symbol #306 (IJ) has no special Latex command
1255 // Symbol #307 (ij) has no special Latex command
1256 RTFCHARS.put("^J", "\\u308J"); // "Jcirc"
1257 RTFCHARS.put("^j", "\\u309j"); // "jcirc"
1258 RTFCHARS.put("cK", "\\u310K"); // "Kcedil"
1259 RTFCHARS.put("ck", "\\u311k"); // "kcedil"
1260 // Symbol #312 (k) has no special Latex command
1261 RTFCHARS.put("'L", "\\u313L"); // "Lacute"
1262 RTFCHARS.put("'l", "\\u314l"); // "lacute"
1263 RTFCHARS.put("cL", "\\u315L"); // "Lcedil"
1264 RTFCHARS.put("cl", "\\u316l"); // "lcedil"
1265 // Symbol #317 (L�) has no special Latex command
1266 // Symbol #318 (l�) has no special Latex command
1267 RTFCHARS.put("Lmidot", "\\u319L"); // "Lmidot"
1268 RTFCHARS.put("lmidot", "\\u320l"); // "lmidot"
1269 RTFCHARS.put("L", "\\u321L"); // "Lstrok"
1270 RTFCHARS.put("l", "\\u322l"); // "lstrok"
1271 RTFCHARS.put("'N", "\\u323N"); // "Nacute"
1272 RTFCHARS.put("'n", "\\u324n"); // "nacute"
1273 RTFCHARS.put("cN", "\\u325N"); // "Ncedil"
1274 RTFCHARS.put("cn", "\\u326n"); // "ncedil"
1275 RTFCHARS.put("vN", "\\u327N"); // "Ncaron"
1276 RTFCHARS.put("vn", "\\u328n"); // "ncaron"
1277 // Symbol #329 (�n) has no special Latex command
1278 RTFCHARS.put("NG", "\\u330G"); // "ENG"
1279 RTFCHARS.put("ng", "\\u331g"); // "eng"
1280 RTFCHARS.put("=O", "\\u332O"); // "Omacr"
1281 RTFCHARS.put("=o", "\\u333o"); // "omacr"
1282 RTFCHARS.put("uO", "\\u334O"); // "Obreve"
1283 RTFCHARS.put("uo", "\\u335o"); // "obreve"
1284 RTFCHARS.put("HO", "\\u336?"); // "Odblac"
1285 RTFCHARS.put("Ho", "\\u337?"); // "odblac"
1286 RTFCHARS.put("OE", "{\\uc2\\u338OE}"); // "OElig"
1287 RTFCHARS.put("oe", "{\\uc2\\u339oe}"); // "oelig"
1288 RTFCHARS.put("'R", "\\u340R"); // "Racute"
1289 RTFCHARS.put("'r", "\\u341r"); // "racute"
1290 RTFCHARS.put("cR", "\\u342R"); // "Rcedil"
1291 RTFCHARS.put("cr", "\\u343r"); // "rcedil"
1292 RTFCHARS.put("vR", "\\u344R"); // "Rcaron"
1293 RTFCHARS.put("vr", "\\u345r"); // "rcaron"
1294 RTFCHARS.put("'S", "\\u346S"); // "Sacute"
1295 RTFCHARS.put("'s", "\\u347s"); // "sacute"
1296 RTFCHARS.put("^S", "\\u348S"); // "Scirc"
1297 RTFCHARS.put("^s", "\\u349s"); // "scirc"
1298 RTFCHARS.put("cS", "\\u350S"); // "Scedil"
1299 RTFCHARS.put("cs", "\\u351s"); // "scedil"
1300 RTFCHARS.put("vS", "\\u352S"); // "Scaron"
1301 RTFCHARS.put("vs", "\\u353s"); // "scaron"
1302 RTFCHARS.put("cT", "\\u354T"); // "Tcedil"
1303 RTFCHARS.put("ct", "\\u355t"); // "tcedil"
1304 RTFCHARS.put("vT", "\\u356T"); // "Tcaron"
1305 // Symbol #357 (t�) has no special Latex command
1306 RTFCHARS.put("Tstrok", "\\u358T"); // "Tstrok"
1307 RTFCHARS.put("tstrok", "\\u359t"); // "tstrok"
1308 RTFCHARS.put("~U", "\\u360U"); // "Utilde"
1309 RTFCHARS.put("~u", "\\u361u"); // "utilde"
1310 RTFCHARS.put("=U", "\\u362U"); // "Umacr"
1311 RTFCHARS.put("=u", "\\u363u"); // "umacr"
1312 RTFCHARS.put("uU", "\\u364U"); // "Ubreve"
1313 RTFCHARS.put("uu", "\\u365u"); // "ubreve"
1314 RTFCHARS.put("rU", "\\u366U"); // "Uring"
1315 RTFCHARS.put("ru", "\\u367u"); // "uring"
1316 RTFCHARS.put("HU", "\\u368?"); // "Odblac"
1317 RTFCHARS.put("Hu", "\\u369?"); // "odblac"
1318 RTFCHARS.put("kU", "\\u370U"); // "Uogon"
1319 RTFCHARS.put("ku", "\\u371u"); // "uogon"
1320 RTFCHARS.put("^W", "\\u372W"); // "Wcirc"
1321 RTFCHARS.put("^w", "\\u373w"); // "wcirc"
1322 RTFCHARS.put("^Y", "\\u374Y"); // "Ycirc"
1323 RTFCHARS.put("^y", "\\u375y"); // "ycirc"
1324 RTFCHARS.put("\"Y","\\u376Y"); // "Yuml"
1325 RTFCHARS.put("'Z", "\\u377Z"); // "Zacute"
1326 RTFCHARS.put("'z", "\\u378z"); // "zacute"
1327 RTFCHARS.put(".Z", "\\u379Z"); // "Zdot"
1328 RTFCHARS.put(".z", "\\u380z"); // "zdot"
1329 RTFCHARS.put("vZ", "\\u381Z"); // "Zcaron"
1330 RTFCHARS.put("vz", "\\u382z"); // "zcaron"
1331 // Symbol #383 (f) has no special Latex command
1333 // XML_CHARS.put("\\u00E1", "á");
1336 public static void initializeJournalNames() {
1337 journalAbbrev = new JournalAbbreviations("/resource/IEEEJournalList.txt");
1339 // Read external lists, if any (in reverse order, so the upper lists
1340 // override the lower):
1341 String[] lists = prefs.getStringArray("externalJournalLists");
1342 if ((lists != null) && (lists.length > 0)) {
1343 for (int i = lists.length - 1; i >= 0; i--) {
1345 journalAbbrev.readJournalList(new File(lists[i]));
1346 } catch (FileNotFoundException e) {
1347 // The file couldn't be found... should we tell anyone?
1348 Globals.logger(e.getMessage());
1353 // Read personal list, if set up:
1354 if (prefs.get("personalJournalList") != null) {
1356 journalAbbrev.readJournalList(new File(prefs.get("personalJournalList")));
1357 } catch (FileNotFoundException e) {
1358 Globals.logger("Personal journal list file '" + prefs.get("personalJournalList")