History

Restored codepage autodetection, as it is working now

Dmitry Kabak (userdima committed 13 years ago

Commit 9bb2f901 parent c9890111 file · +9 −13Browse files

Showing the changes to java (1 of 1 file). Show all

Unified · Split

java/pkg/java/nio/charset/Charset.java+9−13
@@ -612,19 +612,15 @@ public abstract class Charset · 611 unmodified lines
612612 */
613613 public static Charset defaultCharset() {
614614 if (defaultCharset == null) {
615− // [Inferno] <
616− //synchronized (Charset.class) {
617− // String csn = AccessController.doPrivileged(
618− // new GetPropertyAction("file.encoding"));
619− // Charset cs = lookup(csn);
620− // if (cs != null)
621− // defaultCharset = cs;
622− // else
623− // defaultCharset = forName("UTF-8");
624− //}
625− // [Inferno] =
626− defaultCharset = forName("UTF-8");
627− // [Inferno] >
615+ synchronized (Charset.class) {
616+ String csn = AccessController.doPrivileged(
617+ new GetPropertyAction("file.encoding"));
618+ Charset cs = lookup(csn);
619+ if (cs != null)
620+ defaultCharset = cs;
621+ else
622+ defaultCharset = forName("UTF-8");
623+ }
628624 }
629625 return defaultCharset;
630626 }