8264208: Console charset API

Reviewed-by: joehw, rriggs, alanb
This commit is contained in:
Naoto Sato 2021-04-23 18:57:03 +00:00
parent 5aab1609b9
commit bebfae48e3
10 changed files with 202 additions and 30 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, 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
@ -454,6 +454,12 @@ GetJavaProperties(JNIEnv *env)
#else
sprops.sun_jnu_encoding = sprops.encoding;
#endif
if (isatty(STDOUT_FILENO) == 1) {
sprops.sun_stdout_encoding = sprops.encoding;
}
if (isatty(STDERR_FILENO) == 1) {
sprops.sun_stderr_encoding = sprops.encoding;
}
#ifdef _ALLBSD_SOURCE
#if BYTE_ORDER == _LITTLE_ENDIAN