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;
29 import java.nio.charset.Charset;
31 import java.util.List;
32 import java.util.logging.* ;
33 import java.util.logging.Filter ;
36 import javax.swing.* ;
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;
43 public class Globals {
45 public static int SHORTCUT_MASK,// = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
46 FUTURE_YEAR = 2050, // Needs to give a year definitely in the future. Used for guessing the
47 // year field when parsing textual data. :-)
49 STANDARD_EXPORT_COUNT = 5, // The number of standard export formats.
50 METADATA_LINE_LENGTH = 70; // The line length used to wrap metadata.
52 private static String resourcePrefix = "resource/JabRef",
53 menuResourcePrefix = "resource/Menu",
54 integrityResourcePrefix = "resource/IntegrityMessage";
55 private static final String buildInfos = "/resource/build.properties" ;
56 public static final String additionalFields = "/resource/fields/fields.xml" ; // some extra field definitions
57 private static String logfile = "jabref.log";
58 public static ResourceBundle messages, menuTitles, intMessages ;
59 public static FileUpdateMonitor fileUpdateMonitor = new FileUpdateMonitor();
60 public static ImportFormatReader importFormatReader = new ImportFormatReader();
62 public static ErrorConsole errorConsole;
64 public static String VERSION,
70 TBuildInfo bi = new TBuildInfo(buildInfos) ;
71 VERSION = bi.getBUILD_VERSION() ;
72 BUILD = bi.getBUILD_NUMBER() ;
73 BUILD_DATE = bi.getBUILD_DATE() ;
75 // TODO: Error console initialization here. When should it be used?
76 errorConsole = ErrorConsole.getInstance();
81 //public static ResourceBundle preferences = ResourceBundle.getBundle("resource/defaultPrefs");
82 public static Locale locale;
83 public static final String FILETYPE_PREFS_EXT = "_dir",
84 SELECTOR_META_PREFIX = "selector_",
85 LAYOUT_PREFIX = "/resource/layout/",
87 DOI_LOOKUP_PREFIX = "http://dx.doi.org/",
89 FORMATTER_PACKAGE = "net.sf.jabref.export.layout.format.";
90 public static float duplicateThreshold = 0.75f;
91 private static Handler consoleHandler = new java.util.logging.ConsoleHandler();
92 public static String[] ENCODINGS,
93 ALL_ENCODINGS = //(String[]) Charset.availableCharsets().keySet().toArray(new String[]{});
94 new String[] {"ISO8859_1", "UTF8", "UTF-16", "ASCII",
95 "Cp1250", "Cp1251", "Cp1252", "Cp1253", "Cp1254", "Cp1257",
96 "JIS", "SJIS", "EUC-JP", // Added Japanese encodings.
97 "Big5", "Big5_HKSCS", "GBK",
98 "ISO8859_2", "ISO8859_3", "ISO8859_4", "ISO8859_5", "ISO8859_6",
99 "ISO8859_7", "ISO8859_8", "ISO8859_9", "ISO8859_13", "ISO8859_15"};
101 // String array that maps from month number to month string label:
102 public static String[] MONTHS = new String[] {"jan", "feb", "mar", "apr", "may", "jun",
103 "jul", "aug", "sep", "oct", "nov", "dec"};
105 // Map that maps from month string labels to
106 public static Map MONTH_STRINGS = new HashMap();
108 MONTH_STRINGS.put("jan", "January");
109 MONTH_STRINGS.put("feb", "February");
110 MONTH_STRINGS.put("mar", "March");
111 MONTH_STRINGS.put("apr", "April");
112 MONTH_STRINGS.put("may", "May");
113 MONTH_STRINGS.put("jun", "June");
114 MONTH_STRINGS.put("jul", "July");
115 MONTH_STRINGS.put("aug", "August");
116 MONTH_STRINGS.put("sep", "September");
117 MONTH_STRINGS.put("oct", "October");
118 MONTH_STRINGS.put("nov", "November");
119 MONTH_STRINGS.put("dec", "December");
121 // Build list of encodings, by filtering out all that are not supported
123 List encodings = new ArrayList();
124 for (int i=0; i<ALL_ENCODINGS.length; i++) {
125 if (Charset.isSupported(ALL_ENCODINGS[i]))
126 encodings.add(ALL_ENCODINGS[i]);
128 ENCODINGS = (String[])encodings.toArray(new String[0]);
133 public static GlobalFocusListener focusListener = new GlobalFocusListener();
134 public static JabRefPreferences prefs = null;
135 public static HelpDialog helpDiag = null;
136 public static String osName = System.getProperty("os.name", "def");
137 public static boolean ON_MAC = (osName.equals(MAC)),
138 ON_WIN = osName.startsWith("Windows");
141 public static String[] SKIP_WORDS = {"a", "an", "the", "for", "on"};
142 public static SidePaneManager sidePaneManager;
143 public static final String NEWLINE = System.getProperty("line.separator");
144 public static final boolean UNIX_NEWLINE = NEWLINE.equals("\n"); // true if we have unix newlines.
146 public static final String BIBTEX_STRING = "__string";
147 // "Fieldname" to indicate that a field should be treated as a bibtex string. Used when writing database to file.
149 public static void logger(String s) {
150 Logger.global.info(s);
153 public static void turnOffLogging() { // only log exceptions
154 Logger.global.setLevel(java.util.logging.Level.SEVERE);
157 // should be only called once
158 public static void turnOnConsoleLogging() {
159 Logger.global.addHandler(consoleHandler);
165 public static void turnOnFileLogging() {
166 Logger.global.setLevel(java.util.logging.Level.ALL);
167 java.util.logging.Handler handler;
168 handler = new ConsoleHandler();
170 handler = new FileHandler(logfile); // this will overwrite
172 catch (IOException e) { //can't open log file so use console
176 Logger.global.addHandler(handler);
178 handler.setFilter(new Filter() { // select what gets logged
179 public boolean isLoggable(LogRecord record) {
185 public static void setLanguage(String language, String country) {
186 locale = new Locale(language, country);
187 messages = ResourceBundle.getBundle(resourcePrefix, locale);
188 menuTitles = ResourceBundle.getBundle(menuResourcePrefix, locale);
189 intMessages = ResourceBundle.getBundle(integrityResourcePrefix, locale);
190 Locale.setDefault(locale);
191 javax.swing.JComponent.setDefaultLocale(locale);
195 public static JournalAbbreviations journalAbbrev;
198 public static String lang(String key, String[] params) {
199 String translation = null;
201 if (Globals.messages != null) {
202 translation = Globals.messages.getString(key.replaceAll(" ", "_"));
205 catch (MissingResourceException ex) {
208 //Thread.dumpStack(); // For debugging
209 logger("Warning: could not get translation for \""
212 if ((translation != null) && (translation.length() != 0)) {
213 translation = translation.replaceAll("_", " ");
214 StringBuffer sb = new StringBuffer();
217 for (int i = 0; i < translation.length(); ++i) {
218 c = translation.charAt(i);
227 int index = Integer.parseInt(String.valueOf(c));
228 if (params != null && index >= 0 && index <= params.length)
229 sb.append(params[index]);
230 } catch (NumberFormatException e) {
231 // append literally (for quoting) or insert special symbol
239 default: // anything else, e.g. %
246 return sb.toString();
251 public static String lang(String key) {
252 return lang(key, (String[])null);
255 public static String lang(String key, String s1) {
256 return lang(key, new String[]{s1});
259 public static String lang(String key, String s1, String s2) {
260 return lang(key, new String[]{s1, s2});
263 public static String lang(String key, String s1, String s2, String s3) {
264 return lang(key, new String[]{s1, s2, s3});
267 public static String menuTitle(String key) {
268 String translation = null;
270 if (Globals.messages != null) {
271 translation = Globals.menuTitles.getString(key.replaceAll(" ", "_"));
274 catch (MissingResourceException ex) {
277 //System.err.println("Warning: could not get menu item translation for \""
281 if ((translation != null) && (translation.length() != 0)) {
282 return translation.replaceAll("_", " ");
289 public static String getIntegrityMessage(String key)
291 String translation = null;
293 if (Globals.intMessages != null) {
294 translation = Globals.intMessages.getString(key);
297 catch (MissingResourceException ex) {
300 // System.err.println("Warning: could not get menu item translation for \""
303 if ((translation != null) && (translation.length() != 0)) {
312 //============================================================
313 // Using the hashmap of entry types found in BibtexEntryType
314 //============================================================
315 public static BibtexEntryType getEntryType(String type) {
316 // decide which entryType object to return
317 Object o = BibtexEntryType.ALL_TYPES.get(type);
319 return (BibtexEntryType) o;
322 return BibtexEntryType.OTHER;
325 if(type.equals("article"))
326 return BibtexEntryType.ARTICLE;
327 else if(type.equals("book"))
328 return BibtexEntryType.BOOK;
329 else if(type.equals("inproceedings"))
330 return BibtexEntryType.INPROCEEDINGS;
335 * This method provides the correct opening brace to use when writing a field
337 * @return A String containing the braces to use.
339 public static String getOpeningBrace() {
342 As of version 2.0, storing all fields with double braces is no longer supported, because
343 it causes problems with e.g. the author field.
345 if (prefs.getBoolean("autoDoubleBraces"))
353 * This method provides the correct closing brace to use when writing a field
355 * @return A String containing the braces to use.
357 public static String getClosingBrace() {
360 As of version 2.0, storing all fields with double braces is no longer supported, because
361 it causes problems with e.g. the author field.
363 if (prefs.getBoolean("autoDoubleBraces"))
370 /* public static void setupKeyBindings(JabRefPreferences prefs) {
374 public static String[] getMultipleFiles(JFrame owner,
375 File directory, String extension,
376 boolean updateWorkingdirectory) {
378 OpenFileFilter off = null;
379 if (extension == null)
380 off = new OpenFileFilter();
381 else if (!extension.equals(NONE))
382 off = new OpenFileFilter(extension);
383 Object o = getNewFileImpl(owner, directory, extension, null, off,
384 JFileChooser.OPEN_DIALOG, updateWorkingdirectory, false, true);
386 if (o instanceof String[])
387 toReturn = (String[])o;
388 else toReturn = new String[] {(String)o};
393 public static String getNewFile(JFrame owner,
394 File directory, String extension,
396 boolean updateWorkingDirectory) {
397 return getNewFile(owner, directory, extension, null, dialogType,
398 updateWorkingDirectory, false);
402 public static String getNewFile(JFrame owner,
403 File directory, String extension,
406 boolean updateWorkingDirectory) {
407 return getNewFile(owner, directory, extension, description, dialogType,
408 updateWorkingDirectory, false);
412 public static String getNewDir(JFrame owner,
413 File directory, String extension,
414 int dialogType, boolean updateWorkingDirectory) {
415 return getNewFile(owner, directory, extension, null, dialogType,
416 updateWorkingDirectory, true);
419 public static String getNewDir(JFrame owner,
420 File directory, String extension,
422 int dialogType, boolean updateWorkingDirectory) {
423 return getNewFile(owner, directory, extension, description, dialogType,
424 updateWorkingDirectory, true);
427 private static String getNewFile(JFrame owner,
428 File directory, String extension,
431 boolean updateWorkingDirectory,
434 OpenFileFilter off = null;
436 if (extension == null)
437 off = new OpenFileFilter();
438 else if (!extension.equals(NONE))
439 off = new OpenFileFilter(extension);
441 return (String)getNewFileImpl(owner, directory, extension, description, off,
442 dialogType, updateWorkingDirectory, dirOnly, false);
445 private static Object getNewFileImpl(JFrame owner,
446 File directory, String extension,
450 boolean updateWorkingDirectory,
452 boolean multipleSelection) {
454 if (ON_MAC && prefs.getBoolean("useNativeFileDialogOnMac")) {
456 return getNewFileForMac(owner, directory, extension, dialogType,
457 updateWorkingDirectory, dirOnly, off);
460 JFileChooser fc = null;
462 fc = new JabRefFileChooser(directory);
463 } catch (InternalError errl) {
464 // This try/catch clause was added because a user reported an
465 // InternalError getting thrown on WinNT, presumably because of a
466 // bug in JGoodies Windows PLAF. This clause can be removed if the
467 // bug is fixed, but for now we just resort to the native file
468 // dialog, using the same method as is always used on Mac:
469 return getNewFileForMac(owner, directory, extension, dialogType,
470 updateWorkingDirectory, dirOnly, off);
474 fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
478 fc.setMultiSelectionEnabled(multipleSelection);
480 fc.addChoosableFileFilter(off);
481 fc.setDialogType(dialogType);
483 if (dialogType == JFileChooser.OPEN_DIALOG) {
484 dialogResult = fc.showOpenDialog(owner);
485 } else if (dialogType == JFileChooser.SAVE_DIALOG) {
486 dialogResult = fc.showSaveDialog(owner);
488 dialogResult = fc.showDialog(owner, description);
491 // the getSelectedFile method returns a valid fileselection
492 // (if something is selected) indepentently from dialog return status
493 if (dialogResult != JFileChooser.APPROVE_OPTION)
497 File selectedFile = fc.getSelectedFile();
498 if (selectedFile == null) { // cancel
502 // If this is a save dialog, and the user has not chosen "All files" as filter
503 // we enforce the given extension. But only if extension is not null.
504 if ((extension != null) && (dialogType == JFileChooser.SAVE_DIALOG) && (fc.getFileFilter() == off) &&
505 !off.accept(selectedFile)) {
507 // add the first extension if there are multiple extensions
508 selectedFile = new File(selectedFile.getPath() + extension.split("[, ]+", 0)[0]);
511 if (updateWorkingDirectory) {
512 prefs.put("workingDirectory", selectedFile.getPath());
515 if (!multipleSelection)
516 return selectedFile.getAbsolutePath();
518 File[] files = fc.getSelectedFiles();
519 String[] filenames = new String[files.length];
520 for (int i=0; i<files.length; i++)
521 filenames[i] = files[i].getAbsolutePath();
526 private static String getNewFileForMac(JFrame owner,
527 File directory, String extensions,
529 boolean updateWorkingDirectory,
531 FilenameFilter filter) {
533 FileDialog fc = new FileDialog(owner);
535 //fc.setFilenameFilter(filter);
536 if (directory != null) {
537 fc.setDirectory(directory.getParent());
539 if (dialogType == JFileChooser.OPEN_DIALOG) {
540 fc.setMode(FileDialog.LOAD);
543 fc.setMode(FileDialog.SAVE);
546 fc.setVisible(true); // fc.show(); -> deprecated since 1.5
548 if (fc.getFile() != null) {
549 Globals.prefs.put("workingDirectory", fc.getDirectory() + fc.getFile());
550 return fc.getDirectory() + fc.getFile();
558 public static String SPECIAL_COMMAND_CHARS = "\"`^~'c";
559 public static HashMap HTML_CHARS = new HashMap(),
560 HTMLCHARS = new HashMap(),
561 XML_CHARS = new HashMap(),
562 ASCII2XML_CHARS = new HashMap(),
563 UNICODE_CHARS = new HashMap(),
564 RTFCHARS = new HashMap(),
565 URL_CHARS = new HashMap();
568 //System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", true));
569 //System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", false));
570 //System.out.println(journalAbbrev.getFullName("Aquaculture Eng."));
571 /*for (Iterator i=journalAbbrev.fullNameIterator(); i.hasNext();) {
572 String s = (String)i.next();
573 System.out.println(journalAbbrev.getFullName(s)+" : "+journalAbbrev.getAbbreviatedName(s, true));
576 // Start the thread that monitors file time stamps.
577 //Util.pr("Starting FileUpdateMonitor thread. Globals line 293.");
578 fileUpdateMonitor.start();
581 SHORTCUT_MASK = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
582 } catch (Throwable t) {
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");
598 // HTMLCHARS.put("\"a", "ä");
599 // HTMLCHARS.put("\"A", "Ä");
600 // HTMLCHARS.put("\"e", "ë");
601 // HTMLCHARS.put("\"E", "Ë");
602 // HTMLCHARS.put("\"i", "ï");
603 // HTMLCHARS.put("\"I", "Ï");
604 // HTMLCHARS.put("\"o", "ö");
605 // HTMLCHARS.put("\"O", "Ö");
606 // HTMLCHARS.put("\"u", "ü");
607 // HTMLCHARS.put("\"U", "Ü");
608 // HTMLCHARS.put("`a", "à");
609 // HTMLCHARS.put("`A", "À");
610 // HTMLCHARS.put("`e", "è");
611 // HTMLCHARS.put("`E", "È");
612 // HTMLCHARS.put("`i", "ì");
613 // HTMLCHARS.put("`I", "Ì");
614 // HTMLCHARS.put("`o", "ò");
615 // HTMLCHARS.put("`O", "Ò");
616 // HTMLCHARS.put("`u", "ù");
617 // HTMLCHARS.put("`U", "Ù");
618 // HTMLCHARS.put("'e", "é");
619 // HTMLCHARS.put("'E", "É");
620 // HTMLCHARS.put("'i", "í");
621 // HTMLCHARS.put("'I", "Í");
622 // HTMLCHARS.put("'o", "ó");
623 // HTMLCHARS.put("'O", "Ó");
624 // HTMLCHARS.put("'u", "ú");
625 // HTMLCHARS.put("'U", "Ú");
626 // HTMLCHARS.put("'a", "á");
627 // HTMLCHARS.put("'A", "Á");
628 // HTMLCHARS.put("^a", "ô");
629 // HTMLCHARS.put("^A", "Ô");
630 // HTMLCHARS.put("^o", "ô");
631 // HTMLCHARS.put("^O", "Ô");
632 // HTMLCHARS.put("^u", "û");
633 // HTMLCHARS.put("^U", "Û");
634 // HTMLCHARS.put("^e", "ê");
635 // HTMLCHARS.put("^E", "Ê");
636 // HTMLCHARS.put("^i", "î");
637 // HTMLCHARS.put("^I", "Î");
638 // HTMLCHARS.put("~o", "õ");
639 // HTMLCHARS.put("~O", "Õ");
640 // HTMLCHARS.put("~n", "ñ");
641 // HTMLCHARS.put("~N", "Ñ");
642 // HTMLCHARS.put("~a", "ã");
643 // HTMLCHARS.put("~A", "Ã");
644 // HTMLCHARS.put("cc", "ç");
645 // HTMLCHARS.put("cC", "Ç");
648 // Following character definitions contributed by Ervin Kolenovic:
649 // HTML named entities from #192 - #255 (UNICODE Latin-1)
650 HTMLCHARS.put("`A", "À"); // #192
651 HTMLCHARS.put("'A", "Á"); // #193
652 HTMLCHARS.put("^A", "Â"); // #194
653 HTMLCHARS.put("~A", "Ã"); // #195
654 HTMLCHARS.put("\"A", "Ä"); // #196
655 HTMLCHARS.put("AA", "Å"); // #197
656 HTMLCHARS.put("AE", "Æ"); // #198
657 HTMLCHARS.put("cC", "Ç"); // #199
658 HTMLCHARS.put("`E", "È"); // #200
659 HTMLCHARS.put("'E", "É"); // #201
660 HTMLCHARS.put("^E", "Ê"); // #202
661 HTMLCHARS.put("\"E", "Ë"); // #203
662 HTMLCHARS.put("`I", "Ì"); // #204
663 HTMLCHARS.put("'I", "Í"); // #205
664 HTMLCHARS.put("^I", "Î"); // #206
665 HTMLCHARS.put("\"I", "Ï"); // #207
666 HTMLCHARS.put("DH", "Ð"); // #208
667 HTMLCHARS.put("~N", "Ñ"); // #209
668 HTMLCHARS.put("`O", "Ò"); // #210
669 HTMLCHARS.put("'O", "Ó"); // #211
670 HTMLCHARS.put("^O", "Ô"); // #212
671 HTMLCHARS.put("~O", "Õ"); // #213
672 HTMLCHARS.put("\"O", "Ö"); // #214
673 // According to ISO 8859-1 the "\times" symbol should be placed here (#215).
674 // Omitting this, because it is a mathematical symbol.
675 HTMLCHARS.put("O", "&OSlash;"); // #216
676 HTMLCHARS.put("`U", "Ù"); // #217
677 HTMLCHARS.put("'U", "Ú"); // #218
678 HTMLCHARS.put("^U", "Û"); // #219
679 HTMLCHARS.put("\"U", "Ü"); // #220
680 HTMLCHARS.put("'Y", "Ý"); // #221
681 HTMLCHARS.put("TH", "Þ"); // #222
682 HTMLCHARS.put("ss", "ß"); // #223
683 HTMLCHARS.put("`a", "à"); // #224
684 HTMLCHARS.put("'a", "á"); // #225
685 HTMLCHARS.put("^a", "â"); // #226
686 HTMLCHARS.put("~a", "ã"); // #227
687 HTMLCHARS.put("\"a", "ä"); // #228
688 HTMLCHARS.put("aa", "å"); // #229
689 HTMLCHARS.put("ae", "æ"); // #230
690 HTMLCHARS.put("cc", "ç"); // #231
691 HTMLCHARS.put("`e", "è"); // #232
692 HTMLCHARS.put("'e", "é"); // #233
693 HTMLCHARS.put("^e", "ê"); // #234
694 HTMLCHARS.put("\"e", "ë"); // #235
695 HTMLCHARS.put("`i", "ì"); // #236
696 HTMLCHARS.put("'i", "í"); // #237
697 HTMLCHARS.put("^i", "î"); // #238
698 HTMLCHARS.put("\"i", "ï"); // #239
699 HTMLCHARS.put("dh", "ð"); // #240
700 HTMLCHARS.put("~n", "ñ"); // #241
701 HTMLCHARS.put("`o", "ò"); // #242
702 HTMLCHARS.put("'o", "ó"); // #243
703 HTMLCHARS.put("^o", "ô"); // #244
704 HTMLCHARS.put("~o", "õ"); // #245
705 HTMLCHARS.put("\"o", "ö"); // #246
706 // According to ISO 8859-1 the "\div" symbol should be placed here (#247).
707 // Omitting this, because it is a mathematical symbol.
708 HTMLCHARS.put("o", "ø"); // #248
709 HTMLCHARS.put("`u", "ù"); // #249
710 HTMLCHARS.put("'u", "ú"); // #250
711 HTMLCHARS.put("^u", "û"); // #251
712 HTMLCHARS.put("\"u", "ü"); // #252
713 HTMLCHARS.put("'y", "ý"); // #253
714 HTMLCHARS.put("th", "þ"); // #254
715 HTMLCHARS.put("\"y", "ÿ"); // #255
717 // HTML special characters without names (UNICODE Latin Extended-A), indicated by UNICODE number
718 HTMLCHARS.put("=A", "Ā"); // "Amacr"
719 HTMLCHARS.put("=a", "ā"); // "amacr"
720 HTMLCHARS.put("uA", "Ă"); // "Abreve"
721 HTMLCHARS.put("ua", "ă"); // "abreve"
722 HTMLCHARS.put("kA", "Ą"); // "Aogon"
723 HTMLCHARS.put("ka", "ą"); // "aogon"
724 HTMLCHARS.put("'C", "Ć"); // "Cacute"
725 HTMLCHARS.put("'c", "ć"); // "cacute"
726 HTMLCHARS.put("^C", "Ĉ"); // "Ccirc"
727 HTMLCHARS.put("^c", "ĉ"); // "ccirc"
728 HTMLCHARS.put(".C", "Ċ"); // "Cdot"
729 HTMLCHARS.put(".c", "ċ"); // "cdot"
730 HTMLCHARS.put("vC", "Č"); // "Ccaron"
731 HTMLCHARS.put("vc", "č"); // "ccaron"
732 HTMLCHARS.put("vD", "Ď"); // "Dcaron"
733 // Symbol #271 (d´) has no special Latex command
734 HTMLCHARS.put("DJ", "Đ"); // "Dstrok"
735 HTMLCHARS.put("dj", "đ"); // "dstrok"
736 HTMLCHARS.put("=E", "Ē"); // "Emacr"
737 HTMLCHARS.put("=e", "ē"); // "emacr"
738 HTMLCHARS.put("uE", "Ĕ"); // "Ebreve"
739 HTMLCHARS.put("ue", "ĕ"); // "ebreve"
740 HTMLCHARS.put(".E", "Ė"); // "Edot"
741 HTMLCHARS.put(".e", "ė"); // "edot"
742 HTMLCHARS.put("kE", "Ę"); // "Eogon"
743 HTMLCHARS.put("ke", "ę"); // "eogon"
744 HTMLCHARS.put("vE", "Ě"); // "Ecaron"
745 HTMLCHARS.put("ve", "ě"); // "ecaron"
746 HTMLCHARS.put("^G", "Ĝ"); // "Gcirc"
747 HTMLCHARS.put("^g", "ĝ"); // "gcirc"
748 HTMLCHARS.put("uG", "Ğ"); // "Gbreve"
749 HTMLCHARS.put("ug", "ğ"); // "gbreve"
750 HTMLCHARS.put(".G", "Ġ"); // "Gdot"
751 HTMLCHARS.put(".g", "ġ"); // "gdot"
752 HTMLCHARS.put("cG", "Ģ"); // "Gcedil"
753 HTMLCHARS.put("'g", "ģ"); // "gacute"
754 HTMLCHARS.put("^H", "Ĥ"); // "Hcirc"
755 HTMLCHARS.put("^h", "ĥ"); // "hcirc"
756 HTMLCHARS.put("Hstrok", "Ħ"); // "Hstrok"
757 HTMLCHARS.put("hstrok", "ħ"); // "hstrok"
758 HTMLCHARS.put("~I", "Ĩ"); // "Itilde"
759 HTMLCHARS.put("~i", "ĩ"); // "itilde"
760 HTMLCHARS.put("=I", "Ī"); // "Imacr"
761 HTMLCHARS.put("=i", "ī"); // "imacr"
762 HTMLCHARS.put("uI", "Ĭ"); // "Ibreve"
763 HTMLCHARS.put("ui", "ĭ"); // "ibreve"
764 HTMLCHARS.put("kI", "Į"); // "Iogon"
765 HTMLCHARS.put("ki", "į"); // "iogon"
766 HTMLCHARS.put(".I", "İ"); // "Idot"
767 HTMLCHARS.put("i", "ı"); // "inodot"
768 // Symbol #306 (IJ) has no special Latex command
769 // Symbol #307 (ij) has no special Latex command
770 HTMLCHARS.put("^J", "Ĵ"); // "Jcirc"
771 HTMLCHARS.put("^j", "ĵ"); // "jcirc"
772 HTMLCHARS.put("cK", "Ķ"); // "Kcedil"
773 HTMLCHARS.put("ck", "ķ"); // "kcedil"
774 // Symbol #312 (k) has no special Latex command
775 HTMLCHARS.put("'L", "Ĺ"); // "Lacute"
776 HTMLCHARS.put("'l", "ĺ"); // "lacute"
777 HTMLCHARS.put("cL", "Ļ"); // "Lcedil"
778 HTMLCHARS.put("cl", "ļ"); // "lcedil"
779 // Symbol #317 (L´) has no special Latex command
780 // Symbol #318 (l´) has no special Latex command
781 HTMLCHARS.put("Lmidot", "Ŀ"); // "Lmidot"
782 HTMLCHARS.put("lmidot", "ŀ"); // "lmidot"
783 HTMLCHARS.put("L", "Ł"); // "Lstrok"
784 HTMLCHARS.put("l", "ł"); // "lstrok"
785 HTMLCHARS.put("'N", "Ń"); // "Nacute"
786 HTMLCHARS.put("'n", "ń"); // "nacute"
787 HTMLCHARS.put("cN", "Ņ"); // "Ncedil"
788 HTMLCHARS.put("cn", "ņ"); // "ncedil"
789 HTMLCHARS.put("vN", "Ň"); // "Ncaron"
790 HTMLCHARS.put("vn", "ň"); // "ncaron"
791 // Symbol #329 (´n) has no special Latex command
792 HTMLCHARS.put("NG", "Ŋ"); // "ENG"
793 HTMLCHARS.put("ng", "ŋ"); // "eng"
794 HTMLCHARS.put("=O", "Ō"); // "Omacr"
795 HTMLCHARS.put("=o", "ō"); // "omacr"
796 HTMLCHARS.put("uO", "Ŏ"); // "Obreve"
797 HTMLCHARS.put("uo", "ŏ"); // "obreve"
798 HTMLCHARS.put("HO", "Ő"); // "Odblac"
799 HTMLCHARS.put("Ho", "ő"); // "odblac"
800 HTMLCHARS.put("OE", "Œ"); // "OElig"
801 HTMLCHARS.put("oe", "œ"); // "oelig"
802 HTMLCHARS.put("'R", "Ŕ"); // "Racute"
803 HTMLCHARS.put("'r", "ŕ"); // "racute"
804 HTMLCHARS.put("cR", "Ŗ"); // "Rcedil"
805 HTMLCHARS.put("cr", "ŗ"); // "rcedil"
806 HTMLCHARS.put("vR", "Ř"); // "Rcaron"
807 HTMLCHARS.put("vr", "ř"); // "rcaron"
808 HTMLCHARS.put("'S", "Ś"); // "Sacute"
809 HTMLCHARS.put("'s", "ś"); // "sacute"
810 HTMLCHARS.put("^S", "Ŝ"); // "Scirc"
811 HTMLCHARS.put("^s", "ŝ"); // "scirc"
812 HTMLCHARS.put("cS", "Ş"); // "Scedil"
813 HTMLCHARS.put("cs", "ş"); // "scedil"
814 HTMLCHARS.put("vS", "Š"); // "Scaron"
815 HTMLCHARS.put("vs", "š"); // "scaron"
816 HTMLCHARS.put("cT", "Ţ"); // "Tcedil"
817 HTMLCHARS.put("ct", "ţ"); // "tcedil"
818 HTMLCHARS.put("vT", "Ť"); // "Tcaron"
819 // Symbol #357 (t´) has no special Latex command
820 HTMLCHARS.put("Tstrok", "Ŧ"); // "Tstrok"
821 HTMLCHARS.put("tstrok", "ŧ"); // "tstrok"
822 HTMLCHARS.put("~U", "Ũ"); // "Utilde"
823 HTMLCHARS.put("~u", "ũ"); // "utilde"
824 HTMLCHARS.put("=U", "Ū"); // "Umacr"
825 HTMLCHARS.put("=u", "ū"); // "umacr"
826 HTMLCHARS.put("uU", "Ŭ"); // "Ubreve"
827 HTMLCHARS.put("uu", "ŭ"); // "ubreve"
828 HTMLCHARS.put("rU", "Ů"); // "Uring"
829 HTMLCHARS.put("ru", "ů"); // "uring"
830 HTMLCHARS.put("HU", "Ű"); // "Odblac"
831 HTMLCHARS.put("Hu", "ű"); // "odblac"
832 HTMLCHARS.put("kU", "Ų"); // "Uogon"
833 HTMLCHARS.put("ku", "ų"); // "uogon"
834 HTMLCHARS.put("^W", "Ŵ"); // "Wcirc"
835 HTMLCHARS.put("^w", "ŵ"); // "wcirc"
836 HTMLCHARS.put("^Y", "Ŷ"); // "Ycirc"
837 HTMLCHARS.put("^y", "ŷ"); // "ycirc"
838 HTMLCHARS.put("\"Y", "Ÿ"); // "Yuml"
839 HTMLCHARS.put("'Z", "Ź"); // "Zacute"
840 HTMLCHARS.put("'z", "ź"); // "zacute"
841 HTMLCHARS.put(".Z", "Ż"); // "Zdot"
842 HTMLCHARS.put(".z", "ż"); // "zdot"
843 HTMLCHARS.put("vZ", "Ž"); // "Zcaron"
844 HTMLCHARS.put("vz", "ž"); // "zcaron"
845 // Symbol #383 (f) has no special Latex command
848 XML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "ä");
849 XML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "Ä");
850 XML_CHARS.put("\\{\\\\\\\"\\{e\\}\\}", "ë");
851 XML_CHARS.put("\\{\\\\\\\"\\{E\\}\\}", "Ë");
852 XML_CHARS.put("\\{\\\\\\\"\\{i\\}\\}", "ï");
853 XML_CHARS.put("\\{\\\\\\\"\\{I\\}\\}", "Ï");
854 XML_CHARS.put("\\{\\\\\\\"\\{o\\}\\}", "ö");
855 XML_CHARS.put("\\{\\\\\\\"\\{O\\}\\}", "Ö");
856 XML_CHARS.put("\\{\\\\\\\"\\{u\\}\\}", "ü");
857 XML_CHARS.put("\\{\\\\\\\"\\{U\\}\\}", "Ü");
859 XML_CHARS.put("\\{\\\\\\`\\{e\\}\\}", "è");
860 XML_CHARS.put("\\{\\\\\\`\\{E\\}\\}", "È");
861 XML_CHARS.put("\\{\\\\\\`\\{i\\}\\}", "ì");
862 XML_CHARS.put("\\{\\\\\\`\\{I\\}\\}", "Ì");
863 XML_CHARS.put("\\{\\\\\\`\\{o\\}\\}", "ò");
864 XML_CHARS.put("\\{\\\\\\`\\{O\\}\\}", "Ò");
865 XML_CHARS.put("\\{\\\\\\`\\{u\\}\\}", "ù");
866 XML_CHARS.put("\\{\\\\\\`\\{U\\}\\}", "Ù");
867 XML_CHARS.put("\\{\\\\\\'\\{e\\}\\}", "é");
868 XML_CHARS.put("\\{\\\\\\\uFFFD\\{E\\}\\}", "É");
869 XML_CHARS.put("\\{\\\\\\\uFFFD\\{i\\}\\}", "í");
870 XML_CHARS.put("\\{\\\\\\\uFFFD\\{I\\}\\}", "Í");
871 XML_CHARS.put("\\{\\\\\\\uFFFD\\{o\\}\\}", "ó");
872 XML_CHARS.put("\\{\\\\\\\uFFFD\\{O\\}\\}", "Ó");
873 XML_CHARS.put("\\{\\\\\\\uFFFD\\{u\\}\\}", "ú");
874 XML_CHARS.put("\\{\\\\\\\uFFFD\\{U\\}\\}", "Ú");
875 XML_CHARS.put("\\{\\\\\\\uFFFD\\{a\\}\\}", "á");
876 XML_CHARS.put("\\{\\\\\\\uFFFD\\{A\\}\\}", "Á");
878 XML_CHARS.put("\\{\\\\\\^\\{o\\}\\}", "ô");
879 XML_CHARS.put("\\{\\\\\\^\\{O\\}\\}", "Ô");
880 XML_CHARS.put("\\{\\\\\\^\\{u\\}\\}", "ù");
881 XML_CHARS.put("\\{\\\\\\^\\{U\\}\\}", "Ù");
882 XML_CHARS.put("\\{\\\\\\^\\{e\\}\\}", "ê");
883 XML_CHARS.put("\\{\\\\\\^\\{E\\}\\}", "Ê");
884 XML_CHARS.put("\\{\\\\\\^\\{i\\}\\}", "î");
885 XML_CHARS.put("\\{\\\\\\^\\{I\\}\\}", "Î");
886 XML_CHARS.put("\\{\\\\\\~\\{o\\}\\}", "õ");
887 XML_CHARS.put("\\{\\\\\\~\\{O\\}\\}", "Õ");
888 XML_CHARS.put("\\{\\\\\\~\\{n\\}\\}", "ñ");
889 XML_CHARS.put("\\{\\\\\\~\\{N\\}\\}", "Ñ");
890 XML_CHARS.put("\\{\\\\\\~\\{a\\}\\}", "ã");
891 XML_CHARS.put("\\{\\\\\\~\\{A\\}\\}", "Ã");
894 XML_CHARS.put("\\{\\\\\\\"a\\}", "ä");
895 XML_CHARS.put("\\{\\\\\\\"A\\}", "Ä");
896 XML_CHARS.put("\\{\\\\\\\"e\\}", "ë");
897 XML_CHARS.put("\\{\\\\\\\"E\\}", "Ë");
898 XML_CHARS.put("\\{\\\\\\\"i\\}", "ï");
899 XML_CHARS.put("\\{\\\\\\\"I\\}", "Ï");
900 XML_CHARS.put("\\{\\\\\\\"o\\}", "ö");
901 XML_CHARS.put("\\{\\\\\\\"O\\}", "Ö");
902 XML_CHARS.put("\\{\\\\\\\"u\\}", "ü");
903 XML_CHARS.put("\\{\\\\\\\"U\\}", "Ü");
905 XML_CHARS.put("\\{\\\\\\`e\\}", "è");
906 XML_CHARS.put("\\{\\\\\\`E\\}", "È");
907 XML_CHARS.put("\\{\\\\\\`i\\}", "ì");
908 XML_CHARS.put("\\{\\\\\\`I\\}", "Ì");
909 XML_CHARS.put("\\{\\\\\\`o\\}", "ò");
910 XML_CHARS.put("\\{\\\\\\`O\\}", "Ò");
911 XML_CHARS.put("\\{\\\\\\`u\\}", "ù");
912 XML_CHARS.put("\\{\\\\\\`U\\}", "Ù");
913 XML_CHARS.put("\\{\\\\\\'e\\}", "é");
914 XML_CHARS.put("\\{\\\\\\'E\\}", "É");
915 XML_CHARS.put("\\{\\\\\\'i\\}", "í");
916 XML_CHARS.put("\\{\\\\\\'I\\}", "Í");
917 XML_CHARS.put("\\{\\\\\\'o\\}", "ó");
918 XML_CHARS.put("\\{\\\\\\'O\\}", "Ó");
919 XML_CHARS.put("\\{\\\\\\'u\\}", "ú");
920 XML_CHARS.put("\\{\\\\\\'U\\}", "Ú");
921 XML_CHARS.put("\\{\\\\\\'a\\}", "á");
922 XML_CHARS.put("\\{\\\\\\'A\\}", "Á");
924 XML_CHARS.put("\\{\\\\\\^a\\}", "ô");
925 XML_CHARS.put("\\{\\\\\\^A\\}", "Ô");
926 XML_CHARS.put("\\{\\\\\\^o\\}", "ô");
927 XML_CHARS.put("\\{\\\\\\^O\\}", "Ô");
928 XML_CHARS.put("\\{\\\\\\^u\\}", "ù");
929 XML_CHARS.put("\\{\\\\\\^U\\}", "Ù");
930 XML_CHARS.put("\\{\\\\\\^e\\}", "ê");
931 XML_CHARS.put("\\{\\\\\\^E\\}", "Ê");
932 XML_CHARS.put("\\{\\\\\\^i\\}", "î");
933 XML_CHARS.put("\\{\\\\\\^I\\}", "Î");
934 XML_CHARS.put("\\{\\\\\\~o\\}", "õ");
935 XML_CHARS.put("\\{\\\\\\~O\\}", "Õ");
936 XML_CHARS.put("\\{\\\\\\~n\\}", "ñ");
937 XML_CHARS.put("\\{\\\\\\~N\\}", "Ñ");
938 XML_CHARS.put("\\{\\\\\\~a\\}", "ã");
939 XML_CHARS.put("\\{\\\\\\~A\\}", "Ã");
941 ASCII2XML_CHARS.put("<", "<");
942 ASCII2XML_CHARS.put("\"", """);
943 ASCII2XML_CHARS.put(">", ">");
946 UNICODE_CHARS.put("\u00C0", "A");
947 UNICODE_CHARS.put("\u00C1", "A");
948 UNICODE_CHARS.put("\u00C2", "A");
949 UNICODE_CHARS.put("\u00C3", "A");
950 UNICODE_CHARS.put("\u00C4", "A");
951 UNICODE_CHARS.put("\u00C5", "Aa");
952 UNICODE_CHARS.put("\u00C6", "Ae");
953 UNICODE_CHARS.put("\u00C7", "C");
954 UNICODE_CHARS.put("\u00C8", "E");
955 UNICODE_CHARS.put("\u00C9", "E");
956 UNICODE_CHARS.put("\u00CA", "E");
957 UNICODE_CHARS.put("\u00CB", "E");
958 UNICODE_CHARS.put("\u00CC", "I");
959 UNICODE_CHARS.put("\u00CD", "I");
960 UNICODE_CHARS.put("\u00CE", "I");
961 UNICODE_CHARS.put("\u00CF", "I");
962 UNICODE_CHARS.put("\u00D0", "D");
963 UNICODE_CHARS.put("\u00D1", "N");
964 UNICODE_CHARS.put("\u00D2", "O");
965 UNICODE_CHARS.put("\u00D3", "O");
966 UNICODE_CHARS.put("\u00D4", "O");
967 UNICODE_CHARS.put("\u00D5", "O");
968 UNICODE_CHARS.put("\u00D6", "Oe");
969 UNICODE_CHARS.put("\u00D8", "Oe");
970 UNICODE_CHARS.put("\u00D9", "U");
971 UNICODE_CHARS.put("\u00DA", "U");
972 UNICODE_CHARS.put("\u00DB", "U");
973 UNICODE_CHARS.put("\u00DC", "Ue"); // U umlaut ..
974 UNICODE_CHARS.put("\u00DD", "Y");
975 UNICODE_CHARS.put("\u00DF", "ss");
976 UNICODE_CHARS.put("\u00E0", "a");
977 UNICODE_CHARS.put("\u00E1", "a");
978 UNICODE_CHARS.put("\u00E2", "a");
979 UNICODE_CHARS.put("\u00E3", "a");
980 UNICODE_CHARS.put("\u00E4", "ae");
981 UNICODE_CHARS.put("\u00E5", "aa");
982 UNICODE_CHARS.put("\u00E6", "ae");
983 UNICODE_CHARS.put("\u00E7", "c");
984 UNICODE_CHARS.put("\u00E8", "e");
985 UNICODE_CHARS.put("\u00E9", "e");
986 UNICODE_CHARS.put("\u00EA", "e");
987 UNICODE_CHARS.put("\u00EB", "e");
988 UNICODE_CHARS.put("\u00EC", "i");
989 UNICODE_CHARS.put("\u00ED", "i");
990 UNICODE_CHARS.put("\u00EE", "i");
991 UNICODE_CHARS.put("\u00EF", "i");
992 UNICODE_CHARS.put("\u00F0", "o");
993 UNICODE_CHARS.put("\u00F1", "n");
994 UNICODE_CHARS.put("\u00F2", "o");
995 UNICODE_CHARS.put("\u00F3", "o");
996 UNICODE_CHARS.put("\u00F4", "o");
997 UNICODE_CHARS.put("\u00F5", "o");
998 UNICODE_CHARS.put("\u00F6", "oe");
999 UNICODE_CHARS.put("\u00F8", "oe");
1000 UNICODE_CHARS.put("\u00F9", "u");
1001 UNICODE_CHARS.put("\u00FA", "u");
1002 UNICODE_CHARS.put("\u00FB", "u");
1003 UNICODE_CHARS.put("\u00FC", "ue"); // u umlaut...
1004 UNICODE_CHARS.put("\u00FD", "y");
1005 UNICODE_CHARS.put("\u00FF", "y");
1006 UNICODE_CHARS.put("\u0100", "A");
1007 UNICODE_CHARS.put("\u0101", "a");
1008 UNICODE_CHARS.put("\u0102", "A");
1009 UNICODE_CHARS.put("\u0103", "a");
1010 UNICODE_CHARS.put("\u0104", "A");
1011 UNICODE_CHARS.put("\u0105", "a");
1012 UNICODE_CHARS.put("\u0106", "C");
1013 UNICODE_CHARS.put("\u0107", "c");
1014 UNICODE_CHARS.put("\u0108", "C");
1015 UNICODE_CHARS.put("\u0109", "c");
1016 UNICODE_CHARS.put("\u010A", "C");
1017 UNICODE_CHARS.put("\u010B", "c");
1018 UNICODE_CHARS.put("\u010C", "C");
1019 UNICODE_CHARS.put("\u010D", "c");
1020 UNICODE_CHARS.put("\u010E", "D");
1021 UNICODE_CHARS.put("\u010F", "d");
1022 UNICODE_CHARS.put("\u0110", "D");
1023 UNICODE_CHARS.put("\u0111", "d");
1024 UNICODE_CHARS.put("\u0112", "E");
1025 UNICODE_CHARS.put("\u0113", "e");
1026 UNICODE_CHARS.put("\u0114", "E");
1027 UNICODE_CHARS.put("\u0115", "e");
1028 UNICODE_CHARS.put("\u0116", "E");
1029 UNICODE_CHARS.put("\u0117", "e");
1030 UNICODE_CHARS.put("\u0118", "E");
1031 UNICODE_CHARS.put("\u0119", "e");
1032 UNICODE_CHARS.put("\u011A", "E");
1033 UNICODE_CHARS.put("\u011B", "e");
1034 UNICODE_CHARS.put("\u011C", "G");
1035 UNICODE_CHARS.put("\u011D", "g");
1036 UNICODE_CHARS.put("\u011E", "G");
1037 UNICODE_CHARS.put("\u011F", "g");
1038 UNICODE_CHARS.put("\u0120", "G");
1039 UNICODE_CHARS.put("\u0121", "g");
1040 UNICODE_CHARS.put("\u0122", "G");
1041 UNICODE_CHARS.put("\u0123", "g");
1042 UNICODE_CHARS.put("\u0124", "H");
1043 UNICODE_CHARS.put("\u0125", "h");
1044 UNICODE_CHARS.put("\u0127", "h");
1045 UNICODE_CHARS.put("\u0128", "I");
1046 UNICODE_CHARS.put("\u0129", "i");
1047 UNICODE_CHARS.put("\u012A", "I");
1048 UNICODE_CHARS.put("\u012B", "i");
1049 UNICODE_CHARS.put("\u012C", "I");
1050 UNICODE_CHARS.put("\u012D", "i");
1051 //UNICODE_CHARS.put("\u0100", "");
1053 RTFCHARS.put("`a", "\\'e0");
1054 RTFCHARS.put("`e", "\\'e8");
1055 RTFCHARS.put("`i", "\\'ec");
1056 RTFCHARS.put("`o", "\\'f2");
1057 RTFCHARS.put("`u", "\\'f9");
1058 RTFCHARS.put("?a", "\\'e1");
1059 RTFCHARS.put("?e", "\\'e9");
1060 RTFCHARS.put("?i", "\\'ed");
1061 RTFCHARS.put("?o", "\\'f3");
1062 RTFCHARS.put("?u", "\\'fa");
1063 RTFCHARS.put("^a", "\\'e2");
1064 RTFCHARS.put("^e", "\\'ea");
1065 RTFCHARS.put("^i", "\\'ee");
1066 RTFCHARS.put("^o", "\\'f4");
1067 RTFCHARS.put("^u", "\\'fa");
1068 RTFCHARS.put("\"a", "\\'e4");
1069 RTFCHARS.put("\"e", "\\'eb");
1070 RTFCHARS.put("\"i", "\\'ef");
1071 RTFCHARS.put("\"o", "\\'f6");
1072 RTFCHARS.put("\"u", "\\uc0\\u252");
1073 RTFCHARS.put("~n", "\\'f1");
1074 RTFCHARS.put("`A", "\\'c0");
1075 RTFCHARS.put("`E", "\\'c8");
1076 RTFCHARS.put("`I", "\\'cc");
1077 RTFCHARS.put("`O", "\\'d2");
1078 RTFCHARS.put("`U", "\\'d9");
1079 RTFCHARS.put("?A", "\\'c1");
1080 RTFCHARS.put("?E", "\\'c9");
1081 RTFCHARS.put("?I", "\\'cd");
1082 RTFCHARS.put("?O", "\\'d3");
1083 RTFCHARS.put("?U", "\\'da");
1084 RTFCHARS.put("^A", "\\'c2");
1085 RTFCHARS.put("^E", "\\'ca");
1086 RTFCHARS.put("^I", "\\'ce");
1087 RTFCHARS.put("^O", "\\'d4");
1088 RTFCHARS.put("^U", "\\'db");
1089 RTFCHARS.put("\"A", "\\'c4");
1090 RTFCHARS.put("\"E", "\\'cb");
1091 RTFCHARS.put("\"I", "\\'cf");
1092 RTFCHARS.put("\"O", "\\'d6");
1093 RTFCHARS.put("\"U", "\\'dc");
1094 // Use UNICODE characters for RTF-Chars which can not be found in the standard codepage
1096 // RTFCHARS.put("`A", "\\uc0\\u192"); // "Agrave" exists in standard codepage
1097 RTFCHARS.put("'A", "\\uc0\\u193"); // "Aacute"
1098 // RTFCHARS.put("^A", "\\uc0\\u194"); // "Acirc" exists in standard codepage
1099 RTFCHARS.put("~A", "\\uc0\\u195"); // "Atilde"
1100 // RTFCHARS.put("\"A", "\\uc0\\u196"); // "Auml" exists in standard codepage
1101 RTFCHARS.put("AA", "\\uc0\\u197"); // "Aring"
1102 RTFCHARS.put("AE", "\\uc0\\u198"); // "AElig"
1103 RTFCHARS.put("cC", "\\uc0\\u199"); // "Ccedil"
1104 // RTFCHARS.put("`E", "\\uc0\\u200"); // "Egrave" exists in standard codepage
1105 RTFCHARS.put("'E", "\\uc0\\u201"); // "Eacute"
1106 // RTFCHARS.put("^E", "\\uc0\\u202"); // "Ecirc" exists in standard codepage
1107 // RTFCHARS.put("\"E", "\\uc0\\u203"); // "Euml" exists in standard codepage
1108 // RTFCHARS.put("`I", "\\uc0\\u204"); // "Igrave" exists in standard codepage
1109 RTFCHARS.put("'I", "\\uc0\\u205"); // "Iacute"
1110 // RTFCHARS.put("^I", "\\uc0\\u206"); // "Icirc" exists in standard codepage
1111 // RTFCHARS.put("\"I", "\\uc0\\u207"); // "Iuml" exists in standard codepage
1112 RTFCHARS.put("DH", "\\uc0\\u208"); // "ETH"
1113 RTFCHARS.put("~N", "\\uc0\\u209"); // "Ntilde"
1114 // RTFCHARS.put("`O", "\\uc0\\u210"); // "Ograve" exists in standard codepage
1115 RTFCHARS.put("'O", "\\uc0\\u211"); // "Oacute"
1116 // RTFCHARS.put("^O", "\\uc0\\u212"); // "Ocirc" exists in standard codepage
1117 RTFCHARS.put("~O", "\\uc0\\u213"); // "Otilde"
1118 // RTFCHARS.put("\"O", "\\uc0\\u214"); // "Ouml" exists in standard codepage
1119 // According to ISO 8859-1 the "\times" symbol should be placed here (#215).
1120 // Omitting this, because it is a mathematical symbol.
1121 RTFCHARS.put("O", "\\uc0\\u216"); // "OSlash"
1122 // RTFCHARS.put("`U", "\\uc0\\u217"); // "Ugrave" exists in standard codepage
1123 RTFCHARS.put("'U", "\\uc0\\u218"); // "Uacute"
1124 // RTFCHARS.put("^U", "\\uc0\\u219"); // "Ucirc" exists in standard codepage
1125 // RTFCHARS.put("\"U", "\\uc0\\u220"); // "Uuml" exists in standard codepage
1126 RTFCHARS.put("'Y", "\\uc0\\u221"); // "Yacute"
1127 RTFCHARS.put("TH", "\\uc0\\u222"); // "THORN"
1128 RTFCHARS.put("ss", "\\uc0\\u223"); // "szlig"
1129 // RTFCHARS.put("`a", "\\uc0\\u224"); // "agrave" exists in standard codepage
1130 RTFCHARS.put("'a", "\\uc0\\u225"); // "aacute"
1131 // RTFCHARS.put("^a", "\\uc0\\u226"); // "acirc" exists in standard codepage
1132 RTFCHARS.put("~a", "\\uc0\\u227"); // "atilde"
1133 // RTFCHARS.put("\"a", "\\uc0\\u228"); // "auml" exists in standard codepage
1134 RTFCHARS.put("aa", "\\uc0\\u229"); // "aring"
1135 RTFCHARS.put("ae", "\\uc0\\u230"); // "aelig"
1136 RTFCHARS.put("cc", "\\uc0\\u231"); // "ccedil"
1137 // RTFCHARS.put("`e", "\\uc0\\u232"); // "egrave" exists in standard codepage
1138 RTFCHARS.put("'e", "\\uc0\\u233"); // "eacute"
1139 // RTFCHARS.put("^e", "\\uc0\\u234"); // "ecirc" exists in standard codepage
1140 // RTFCHARS.put("\"e", "\\uc0\\u235"); // "euml" exists in standard codepage
1141 // RTFCHARS.put("`i", "\\uc0\\u236"); // "igrave" exists in standard codepage
1142 RTFCHARS.put("'i", "\\uc0\\u237"); // "iacute"
1143 // RTFCHARS.put("^i", "\\uc0\\u238"); // "icirc" exists in standard codepage
1144 // RTFCHARS.put("\"i", "\\uc0\\u239"); // "iuml" exists in standard codepage
1145 RTFCHARS.put("dh", "\\uc0\\u240"); // "eth"
1146 // RTFCHARS.put("~n", "\\uc0\\u241"); // "ntilde" exists in standard codepage
1147 // RTFCHARS.put("`o", "\\uc0\\u242"); // "ograve" exists in standard codepage
1148 RTFCHARS.put("'o", "\\uc0\\u243"); // "oacute"
1149 // RTFCHARS.put("^o", "\\uc0\\u244"); // "ocirc" exists in standard codepage
1150 RTFCHARS.put("~o", "\\uc0\\u245"); // "otilde"
1151 // RTFCHARS.put("\"o", "\\uc0\\u246"); // "ouml" exists in standard codepage
1152 // According to ISO 8859-1 the "\div" symbol should be placed here (#247).
1153 // Omitting this, because it is a mathematical symbol.
1154 RTFCHARS.put("o", "\\uc0\\u248"); // "oslash"
1155 // RTFCHARS.put("`u", "\\uc0\\u249"); // "ugrave" exists in standard codepage
1156 RTFCHARS.put("'u", "\\uc0\\u250"); // "uacute"
1157 // RTFCHARS.put("^u", "\\uc0\\u251"); // "ucirc" exists in standard codepage
1158 // RTFCHARS.put("\"u", "\\uc0\\u252"); // "uuml" exists in standard codepage
1159 RTFCHARS.put("'y", "\\uc0\\u253"); // "yacute"
1160 RTFCHARS.put("th", "\\uc0\\u254"); // "thorn"
1161 RTFCHARS.put("\"y", "\\uc0\\u255"); // "yuml"
1163 RTFCHARS.put("=A", "\\uc0\\u256"); // "Amacr"
1164 RTFCHARS.put("=a", "\\uc0\\u257"); // "amacr"
1165 RTFCHARS.put("uA", "\\uc0\\u258"); // "Abreve"
1166 RTFCHARS.put("ua", "\\uc0\\u259"); // "abreve"
1167 RTFCHARS.put("kA", "\\uc0\\u260"); // "Aogon"
1168 RTFCHARS.put("ka", "\\uc0\\u261"); // "aogon"
1169 RTFCHARS.put("'C", "\\uc0\\u262"); // "Cacute"
1170 RTFCHARS.put("'c", "\\uc0\\u263"); // "cacute"
1171 RTFCHARS.put("^C", "\\uc0\\u264"); // "Ccirc"
1172 RTFCHARS.put("^c", "\\uc0\\u265"); // "ccirc"
1173 RTFCHARS.put(".C", "\\uc0\\u266"); // "Cdot"
1174 RTFCHARS.put(".c", "\\uc0\\u267"); // "cdot"
1175 RTFCHARS.put("vC", "\\uc0\\u268"); // "Ccaron"
1176 RTFCHARS.put("vc", "\\uc0\\u269"); // "ccaron"
1177 RTFCHARS.put("vD", "\\uc0\\u270"); // "Dcaron"
1178 // Symbol #271 (d´) has no special Latex command
1179 RTFCHARS.put("DJ", "\\uc0\\u272"); // "Dstrok"
1180 RTFCHARS.put("dj", "\\uc0\\u273"); // "dstrok"
1181 RTFCHARS.put("=E", "\\uc0\\u274"); // "Emacr"
1182 RTFCHARS.put("=e", "\\uc0\\u275"); // "emacr"
1183 RTFCHARS.put("uE", "\\uc0\\u276"); // "Ebreve"
1184 RTFCHARS.put("ue", "\\uc0\\u277"); // "ebreve"
1185 RTFCHARS.put(".E", "\\uc0\\u278"); // "Edot"
1186 RTFCHARS.put(".e", "\\uc0\\u279"); // "edot"
1187 RTFCHARS.put("kE", "\\uc0\\u280"); // "Eogon"
1188 RTFCHARS.put("ke", "\\uc0\\u281"); // "eogon"
1189 RTFCHARS.put("vE", "\\uc0\\u282"); // "Ecaron"
1190 RTFCHARS.put("ve", "\\uc0\\u283"); // "ecaron"
1191 RTFCHARS.put("^G", "\\uc0\\u284"); // "Gcirc"
1192 RTFCHARS.put("^g", "\\uc0\\u285"); // "gcirc"
1193 RTFCHARS.put("uG", "\\uc0\\u286"); // "Gbreve"
1194 RTFCHARS.put("ug", "\\uc0\\u287"); // "gbreve"
1195 RTFCHARS.put(".G", "\\uc0\\u288"); // "Gdot"
1196 RTFCHARS.put(".g", "\\uc0\\u289"); // "gdot"
1197 RTFCHARS.put("cG", "\\uc0\\u290"); // "Gcedil"
1198 RTFCHARS.put("'g", "\\uc0\\u291"); // "gacute"
1199 RTFCHARS.put("^H", "\\uc0\\u292"); // "Hcirc"
1200 RTFCHARS.put("^h", "\\uc0\\u293"); // "hcirc"
1201 RTFCHARS.put("Hstrok", "\\uc0\\u294"); // "Hstrok"
1202 RTFCHARS.put("hstrok", "\\uc0\\u295"); // "hstrok"
1203 RTFCHARS.put("~I", "\\uc0\\u296"); // "Itilde"
1204 RTFCHARS.put("~i", "\\uc0\\u297"); // "itilde"
1205 RTFCHARS.put("=I", "\\uc0\\u298"); // "Imacr"
1206 RTFCHARS.put("=i", "\\uc0\\u299"); // "imacr"
1207 RTFCHARS.put("uI", "\\uc0\\u300"); // "Ibreve"
1208 RTFCHARS.put("ui", "\\uc0\\u301"); // "ibreve"
1209 RTFCHARS.put("kI", "\\uc0\\u302"); // "Iogon"
1210 RTFCHARS.put("ki", "\\uc0\\u303"); // "iogon"
1211 RTFCHARS.put(".I", "\\uc0\\u304"); // "Idot"
1212 RTFCHARS.put("i", "\\uc0\\u305"); // "inodot"
1213 // Symbol #306 (IJ) has no special Latex command
1214 // Symbol #307 (ij) has no special Latex command
1215 RTFCHARS.put("^J", "\\uc0\\u308"); // "Jcirc"
1216 RTFCHARS.put("^j", "\\uc0\\u309"); // "jcirc"
1217 RTFCHARS.put("cK", "\\uc0\\u310"); // "Kcedil"
1218 RTFCHARS.put("ck", "\\uc0\\u311"); // "kcedil"
1219 // Symbol #312 (k) has no special Latex command
1220 RTFCHARS.put("'L", "\\uc0\\u313"); // "Lacute"
1221 RTFCHARS.put("'l", "\\uc0\\u314"); // "lacute"
1222 RTFCHARS.put("cL", "\\uc0\\u315"); // "Lcedil"
1223 RTFCHARS.put("cl", "\\uc0\\u316"); // "lcedil"
1224 // Symbol #317 (L´) has no special Latex command
1225 // Symbol #318 (l´) has no special Latex command
1226 RTFCHARS.put("Lmidot", "\\uc0\\u319"); // "Lmidot"
1227 RTFCHARS.put("lmidot", "\\uc0\\u320"); // "lmidot"
1228 RTFCHARS.put("L", "\\uc0\\u321"); // "Lstrok"
1229 RTFCHARS.put("l", "\\uc0\\u322"); // "lstrok"
1230 RTFCHARS.put("'N", "\\uc0\\u323"); // "Nacute"
1231 RTFCHARS.put("'n", "\\uc0\\u324"); // "nacute"
1232 RTFCHARS.put("cN", "\\uc0\\u325"); // "Ncedil"
1233 RTFCHARS.put("cn", "\\uc0\\u326"); // "ncedil"
1234 RTFCHARS.put("vN", "\\uc0\\u327"); // "Ncaron"
1235 RTFCHARS.put("vn", "\\uc0\\u328"); // "ncaron"
1236 // Symbol #329 (´n) has no special Latex command
1237 RTFCHARS.put("NG", "\\uc0\\u330"); // "ENG"
1238 RTFCHARS.put("ng", "\\uc0\\u331"); // "eng"
1239 RTFCHARS.put("=O", "\\uc0\\u332"); // "Omacr"
1240 RTFCHARS.put("=o", "\\uc0\\u333"); // "omacr"
1241 RTFCHARS.put("uO", "\\uc0\\u334"); // "Obreve"
1242 RTFCHARS.put("uo", "\\uc0\\u335"); // "obreve"
1243 RTFCHARS.put("HO", "\\uc0\\u336"); // "Odblac"
1244 RTFCHARS.put("Ho", "\\uc0\\u337"); // "odblac"
1245 RTFCHARS.put("OE", "\\uc0\\u338"); // "OElig"
1246 RTFCHARS.put("oe", "\\uc0\\u339"); // "oelig"
1247 RTFCHARS.put("'R", "\\uc0\\u340"); // "Racute"
1248 RTFCHARS.put("'r", "\\uc0\\u341"); // "racute"
1249 RTFCHARS.put("cR", "\\uc0\\u342"); // "Rcedil"
1250 RTFCHARS.put("cr", "\\uc0\\u343"); // "rcedil"
1251 RTFCHARS.put("vR", "\\uc0\\u344"); // "Rcaron"
1252 RTFCHARS.put("vr", "\\uc0\\u345"); // "rcaron"
1253 RTFCHARS.put("'S", "\\uc0\\u346"); // "Sacute"
1254 RTFCHARS.put("'s", "\\uc0\\u347"); // "sacute"
1255 RTFCHARS.put("^S", "\\uc0\\u348"); // "Scirc"
1256 RTFCHARS.put("^s", "\\uc0\\u349"); // "scirc"
1257 RTFCHARS.put("cS", "\\uc0\\u350"); // "Scedil"
1258 RTFCHARS.put("cs", "\\uc0\\u351"); // "scedil"
1259 RTFCHARS.put("vS", "\\uc0\\u352"); // "Scaron"
1260 RTFCHARS.put("vs", "\\uc0\\u353"); // "scaron"
1261 RTFCHARS.put("cT", "\\uc0\\u354"); // "Tcedil"
1262 RTFCHARS.put("ct", "\\uc0\\u355"); // "tcedil"
1263 RTFCHARS.put("vT", "\\uc0\\u356"); // "Tcaron"
1264 // Symbol #357 (t´) has no special Latex command
1265 RTFCHARS.put("Tstrok", "\\uc0\\u358"); // "Tstrok"
1266 RTFCHARS.put("tstrok", "\\uc0\\u359"); // "tstrok"
1267 RTFCHARS.put("~U", "\\uc0\\u360"); // "Utilde"
1268 RTFCHARS.put("~u", "\\uc0\\u361"); // "utilde"
1269 RTFCHARS.put("=U", "\\uc0\\u362"); // "Umacr"
1270 RTFCHARS.put("=u", "\\uc0\\u363"); // "umacr"
1271 RTFCHARS.put("uU", "\\uc0\\u364"); // "Ubreve"
1272 RTFCHARS.put("uu", "\\uc0\\u365"); // "ubreve"
1273 RTFCHARS.put("rU", "\\uc0\\u366"); // "Uring"
1274 RTFCHARS.put("ru", "\\uc0\\u367"); // "uring"
1275 RTFCHARS.put("HU", "\\uc0\\u368"); // "Odblac"
1276 RTFCHARS.put("Hu", "\\uc0\\u369"); // "odblac"
1277 RTFCHARS.put("kU", "\\uc0\\u370"); // "Uogon"
1278 RTFCHARS.put("ku", "\\uc0\\u371"); // "uogon"
1279 RTFCHARS.put("^W", "\\uc0\\u372"); // "Wcirc"
1280 RTFCHARS.put("^w", "\\uc0\\u373"); // "wcirc"
1281 RTFCHARS.put("^Y", "\\uc0\\u374"); // "Ycirc"
1282 RTFCHARS.put("^y", "\\uc0\\u375"); // "ycirc"
1283 RTFCHARS.put("\"Y", "\\uc0\\u376"); // "Yuml"
1284 RTFCHARS.put("'Z", "\\uc0\\u377"); // "Zacute"
1285 RTFCHARS.put("'z", "\\uc0\\u378"); // "zacute"
1286 RTFCHARS.put(".Z", "\\uc0\\u379"); // "Zdot"
1287 RTFCHARS.put(".z", "\\uc0\\u380"); // "zdot"
1288 RTFCHARS.put("vZ", "\\uc0\\u381"); // "Zcaron"
1289 RTFCHARS.put("vz", "\\uc0\\u382"); // "zcaron"
1290 // Symbol #383 (f) has no special Latex command
1292 //XML_CHARS.put("\\u00E1", "á");
1295 public static void initializeJournalNames() {
1296 journalAbbrev = new JournalAbbreviations();//"/resource/journalList.txt");
1298 // Read external lists, if any (in reverse order, so the upper lists override the lower):
1299 String[] lists = prefs.getStringArray("externalJournalLists");
1300 if ((lists != null) && (lists.length > 0)) {
1301 for (int i=lists.length-1; i>=0; i--) {
1303 journalAbbrev.readJournalList(new File(lists[i]));
1304 } catch (FileNotFoundException e) {
1305 // The file couldn't be found... should we tell anyone?
1306 Globals.logger(e.getMessage());
1311 // Read personal list, if set up:
1312 if (prefs.get("personalJournalList") != null) {
1314 journalAbbrev.readJournalList(new File(prefs.get("personalJournalList")));
1315 } catch (FileNotFoundException e) {
1316 Globals.logger("Personal journal list file '"+prefs.get("personalJournalList")+