Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8352906

stdout/err.encoding on Windows set by incorrect Win32 call

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • core-libs
    • master
    • generic
    • windows

      On Windows, `stdout/err.enoding` is derived from the value returned from the Win32 call `GetConsoleCP()` (https://github.com/openjdk/jdk/blob/c856b3425a70d2aecb6c5c44da36396a5d74b00d/src/java.base/windows/native/libjava/java_props_md.c#L139). The value from `GetConsoleCP()` is supposed to be used for translating input characters. For the output, which is the case for `stdout/err.encoding`, it should be derived from `GetConsoleOutputCP()`, although they seem to return the same value by default (GetOEMCP()).

      cf. https://learn.microsoft.com/en-us/windows/console/console-code-pages

            naoto Naoto Sato
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: