src/java.base/share/classes/java/io/Console.java

Print this page

        

@@ -562,11 +562,11 @@
             try {
                 cs = Charset.forName(csname);
             } catch (Exception x) {}
         }
         if (cs == null)
-            cs = Charset.defaultCharset();
+            cs = Boolean.getBoolean("windows.UnicodeConsole") ? Charset.defaultUnicodeCharset() : Charset.defaultCharset();
         out = StreamEncoder.forOutputStreamWriter(
                   new FileOutputStream(FileDescriptor.out),
                   writeLock,
                   cs);
         pw = new PrintWriter(out, true) { public void close() {} };