RFR: 8352906: stdout/err.encoding on Windows set by incorrect Win32 call [v2]

Alan Bateman alanb at openjdk.org
Thu Mar 27 16:15:20 UTC 2025


On Thu, 27 Mar 2025 15:59:24 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> src/java.base/windows/native/libjava/java_props_md.c line 142:
>> 
>>> 140:         cp = GetConsoleOutputCP();
>>> 141:     } else {
>>> 142:         cp = GetConsoleCP();
>> 
>> Just a reminder that we should handle the case where GetConsoleXXX returns 0 for error. We've seen bugs where "cp0" is used and I think this suggests that it must fail in some environments.
>
> Ah, you mentioned it before which I forgot! Handled the error case too.

How is NULL handled in the callers?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24263#discussion_r2017034386


More information about the core-libs-dev mailing list