
org.jboss.logmanager.handlers.JDKSpecific Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jboss-logmanager Show documentation
Show all versions of jboss-logmanager Show documentation
An implementation of java.util.logging.LogManager
The newest version!
package org.jboss.logmanager.handlers;
import java.io.Console;
import java.nio.charset.Charset;
import java.security.AccessController;
import java.security.PrivilegedAction;
/**
* JDK-specific code relating to {@link Console}.
*/
final class JDKSpecific {
private JDKSpecific() {
}
private static final Charset CONSOLE_CHARSET;
static {
// Make various guesses as to what the encoding of the console is
String encodingName = AccessController
.doPrivileged((PrivilegedAction) () -> System.getProperty("stdout.encoding"));
if (encodingName == null) {
encodingName = AccessController
.doPrivileged((PrivilegedAction) () -> System.getProperty("native.encoding"));
}
CONSOLE_CHARSET = encodingName == null ? Charset.defaultCharset() : Charset.forName(encodingName);
}
static Charset consoleCharset() {
return CONSOLE_CHARSET;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy