Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Windows XP, Russian locale: a codepage change in a child process affects the current console as well #2196

Closed

Description

@Mithgol

See the following screenshot, which is more or less self-explanatory:

screenshot

You may see here that «chcp 65001» in a child process affects the console window of the parent (until «chcp 866» command is issued in the console, which switches the codepage back to the default CP866).

Note 1

You need your Windows console to use raster fonts (not the vector Lucida Console) to experience the problem.

The choice of fonts is controlled by the corresponding setting in the center of the second tab of the familiar console properties dialog.

In Russian locale of Windows XP, that dialog looks like the following:

screenshot of console properties

Note 2

In order to demonstrate the problem, the test string should contain characters within the default codepage (so that they are initially printable in the console), but outside the 7-bit ASCII range (because the 7-bit ASCII characters are not affected).

For example, for Russian locale, the string '\u0422\u0435\u0441\u0442' contains Unicode positions for characters («Тест») that exist in the second (0x80—0xff) half of CP866 (which is the default codepage for Windows consoles of Russian locale).

Origin

This problem was discovered in my search of a workaround for #2190.

Activity

  1. piscisaureus commented on Nov 27, 2011

    @piscisaureus

    This is not something we can solve - the code page is a per-console setting on windows.

  2. Mithgol commented on Nov 28, 2011

    @Mithgol
    Author

    Can the child process be run in its own console? (Does it always reuse the console of the parent?)

  3. piscisaureus commented on Nov 28, 2011

    @piscisaureus

    It is possible, but I don't like console windows to pop up whenever a child process is started. It would be better if we didn't require users to call chcp in te first place.

  4. piscisaureus commented on Nov 28, 2011

    @piscisaureus

    CREATE_NO_WINDOW seems to work. However this will break stdio inheritance when people use the customFds: [0, 1, 2] option.

  5. Mithgol commented on Jul 24, 2012

    @Mithgol
    Author

    Then, I guess, nothing can be done about it.

    I am now closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions