mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8270490: Charset.forName() taking fallback default value
Reviewed-by: joehw, rriggs, serb, dfuchs
This commit is contained in:
parent
a29273336b
commit
168081efc8
3 changed files with 109 additions and 8 deletions
|
@ -582,17 +582,12 @@ public final class Console implements Flushable
|
|||
csname = GetPropertyAction.privilegedGetProperty("sun.stdout.encoding");
|
||||
}
|
||||
if (csname != null) {
|
||||
try {
|
||||
cs = Charset.forName(csname);
|
||||
} catch (Exception ignored) { }
|
||||
cs = Charset.forName(csname, null);
|
||||
}
|
||||
}
|
||||
if (cs == null) {
|
||||
try {
|
||||
cs = Charset.forName(StaticProperty.nativeEncoding());
|
||||
} catch (Exception ignored) {
|
||||
cs = Charset.defaultCharset();
|
||||
}
|
||||
cs = Charset.forName(StaticProperty.nativeEncoding(),
|
||||
Charset.defaultCharset());
|
||||
}
|
||||
|
||||
CHARSET = cs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue