-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Specifically, it sets the default locale to Locale.US, and also sets these system properties:
"file.encoding" = "UTF-8"
"sun.jnu.encoding" = "UTF-8"
This happens in the private no-arg constructor of UJMPSettings (UJMPSettings:59).
We were happily developing a translated Swing application using ResourceBundles and then we were like, "Hey, where'd our texts go?" Because we hadn't maintained our English texts yet.
Currently we have this workaround in our application startup/preparation:
/**
* <p>
* Workaround for a bug in UJMP that causes global settings to be modified, such as {@link Locale#getDefault() the default locale} and various
* {@link System#getProperty(String) system properties}.
* </p>
*/
public static void initializeUjmp() {
// Back up the global settings that are trashed by UJMPSettings's initial setup code
Locale defaultLocale = Locale.getDefault();
String sysPropFileEncoding = System.getProperty( "file.encoding" );
String sysPropSunJnuEncoding = System.getProperty( "sun.jnu.encoding" );
// Initialize UJMPSettings
UJMPSettings.getInstance();
// Undo UJMPSettings's damage
Locale.setDefault( defaultLocale );
System.setProperty( "file.encoding", sysPropFileEncoding );
System.setProperty( "sun.jnu.encoding", sysPropSunJnuEncoding );
}
Metadata
Metadata
Assignees
Labels
No labels