joyent/node — Issue #2196: Windows XP, Russian locale: a codepage change in a child process affects the current console as well
Author: Mithgol
Created: 2011-11-26 07:59:35+00:00
State: open

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

![screenshot](http://i39.tinypic.com/24yr1ud.gif)

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](http://i42.tinypic.com/vpalxg.png)

# 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).