use of org.jabref.preferences.JabRefPreferences in project jabref by JabRef.
the class PreferencesMigrations method upgradeFaultyEncodingStrings.
/**
* Added from Jabref 2.11 beta 4 onwards to fix wrong encoding names
*/
public static void upgradeFaultyEncodingStrings() {
JabRefPreferences prefs = Globals.prefs;
String defaultEncoding = prefs.get(JabRefPreferences.DEFAULT_ENCODING);
if (defaultEncoding == null) {
return;
}
Map<String, String> encodingMap = new HashMap<>();
encodingMap.put("UTF8", "UTF-8");
encodingMap.put("Cp1250", "CP1250");
encodingMap.put("Cp1251", "CP1251");
encodingMap.put("Cp1252", "CP1252");
encodingMap.put("Cp1253", "CP1253");
encodingMap.put("Cp1254", "CP1254");
encodingMap.put("Cp1257", "CP1257");
encodingMap.put("ISO8859_1", "ISO8859-1");
encodingMap.put("ISO8859_2", "ISO8859-2");
encodingMap.put("ISO8859_3", "ISO8859-3");
encodingMap.put("ISO8859_4", "ISO8859-4");
encodingMap.put("ISO8859_5", "ISO8859-5");
encodingMap.put("ISO8859_6", "ISO8859-6");
encodingMap.put("ISO8859_7", "ISO8859-7");
encodingMap.put("ISO8859_8", "ISO8859-8");
encodingMap.put("ISO8859_9", "ISO8859-9");
encodingMap.put("ISO8859_13", "ISO8859-13");
encodingMap.put("ISO8859_15", "ISO8859-15");
encodingMap.put("KOI8_R", "KOI8-R");
encodingMap.put("Big5_HKSCS", "Big5-HKSCS");
encodingMap.put("EUC_JP", "EUC-JP");
if (encodingMap.containsKey(defaultEncoding)) {
prefs.put(JabRefPreferences.DEFAULT_ENCODING, encodingMap.get(defaultEncoding));
}
}
Aggregations