Why sometimes the codepage is invalid in console?

Well, Umm... I am a little furious with the codepages in Windows(R) console.

My aim is to change default CP into specific CP in the console without rebooting.

Sounds easy, right?

In Win7, the default CP can be changed into some CPs, but some cannot.

eg.

> chcp [ 437 | 850 | 852 | 855 | 857 | 860 | 861 | 863 | 865 | 866 | 869 | 65001 | ...  ]
> Active code page: nnn

but some can't, eg.

> chcp [ 932 | 936 | 949 | 950 ]
> Invalid code page

If I want to change default CP into CP (932, 936, 949, 950), I have to get into control panel, change the system locale, and reboot my computer.

Isn't it weird? I am curious about the reason.Thanks.


Solution 1:

In Windows 7 you could only set 932 code page when your windows system wide non-unicode locale set to Japanese (you don't need to install additional language support until you want messages in Japanese ;) ). Unfortunately you need to reboot windows after setting locale. I guess it is the case with other code pages you mentioned. After reboot your default locale will be 932 and you will have Japanese directories separator too:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:¥>chcp
Active code page: 932

C:¥>chcp 65001

Console window recreated after that command:

Active code page: 65001

C:\>