MCPcopy Index your code
hub / github.com/davidgiven/luje / defaultCharset

Method defaultCharset

lib/java/lang/String.java:712–733  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

710 }
711
712 private Charset defaultCharset() {
713 if (DefaultCharset == null) {
714// String encoding = AccessController
715// .doPrivileged(new PriviAction<String>(
716// "file.encoding", "ISO8859_1")); //$NON-NLS-1$ //$NON-NLS-2$
717 String encoding = System.getProperty("file.encoding", "UTF-8");
718 // calling System.getProperty() may cause DefaultCharset to be
719 // initialized
720 try {
721 DefaultCharset = Charset.forName(encoding);
722 } catch (IllegalCharsetNameException e) {
723 // Ignored
724 } catch (UnsupportedCharsetException e) {
725 // Ignored
726 }
727
728 if (DefaultCharset == null) {
729 DefaultCharset = Charset.forName("ISO-8859-1"); //$NON-NLS-1$
730 }
731 }
732 return DefaultCharset;
733 }
734
735 /**
736 * Compares the specified string to this string to determine if the

Callers 2

StringMethod · 0.95
getBytesMethod · 0.95

Calls 2

getPropertyMethod · 0.95
forNameMethod · 0.95

Tested by

no test coverage detected