8283620: System.out does not use the encoding/charset specified in the Javadoc

Reviewed-by: alanb
This commit is contained in:
Naoto Sato 2022-04-26 16:05:20 +00:00
parent 20a132d460
commit 03bcf7b6d1
8 changed files with 51 additions and 33 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -579,7 +579,7 @@ public final class Console implements Flushable
if (istty) {
String csname = encoding();
if (csname == null) {
csname = GetPropertyAction.privilegedGetProperty("sun.stdout.encoding");
csname = GetPropertyAction.privilegedGetProperty("stdout.encoding");
}
if (csname != null) {
cs = Charset.forName(csname, null);