start a new cmd without user specified active code page #8749

Closed
opened 2026-01-31 01:36:59 +00:00 by claunia · 3 comments
Owner

Originally created by @huoxingkf on GitHub (Jun 2, 2020).

Environment

Platform ServicePack Version VersionString


Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0

Also to cmd.exe

Steps to reproduce

In simpled chinese Environmet;
(Run tomcat with jdk 8);
Run file "startup.bat" in directory "apache-tomcat-8.5.46\bin";
A started tomcat window with messy code.

Expected behavior

In started tomcat window the word "info" shoud be printed as "信息" in Simple Chinese Edition;

Actual behavior

In started tomcat window the word "info" is actually printed as messy code"淇℃伅";

Suggested.

This issue is frequently discussed in Chinese forum.

When using comand "Start" to start a new cmd window, the new one is expected to inherit the "Active code Page " from the former one.
Also, the started cmd is expected show in "Windows Terminal" other than a new "cmd" window.

Originally created by @huoxingkf on GitHub (Jun 2, 2020). # Environment Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0 Also to cmd.exe # Steps to reproduce In simpled chinese Environmet; (Run tomcat with jdk 8); Run file "startup.bat" in directory "apache-tomcat-8.5.46\bin"; A started tomcat window with messy code. # Expected behavior In started tomcat window the word "info" shoud be printed as "信息" in Simple Chinese Edition; # Actual behavior In started tomcat window the word "info" is actually printed as messy code"淇℃伅"; <!-- What's actually happening? --> # Suggested. ### This issue is frequently discussed in Chinese forum. When using comand "Start" to start a new cmd window, the new one is expected to inherit the "Active code Page " from the former one. Also, the started cmd is expected show in "Windows Terminal" other than a new "cmd" window.
Author
Owner

@DHowett commented on GitHub (Jun 5, 2020):

We are not planning to change start to pass the codepage on to the new process. Sorry. The console window inherits the active codepage on the system, which should be configured correctly for the display of the system's default language.

@DHowett commented on GitHub (Jun 5, 2020): We are not planning to change `start` to pass the codepage on to the new process. Sorry. The console window inherits the active codepage on the system, which should be configured correctly for the display of the system's default language.
Author
Owner

@eryksun commented on GitHub (Jun 5, 2020):

The console codepage can be customized based on the initial window title that's set by lpTitle in the process STARTUPINFO. Create a subkey for the initial window title that contains the "CodePage" value that you want. For example, if the title is "Simple Chinese":

reg add "HKCU\Console\Simple Chinese" /v CodePage /d 936 /t REG_DWORD

You can pass the title to use as the first quoted string in the start command. For example:

start "Simple Chinese"

This will open a new instance of cmd.exe that's attached to a new console session in which the active codepage is 936. The "Properties" dialog in this case will persist most settings in the "Simple Chinese" registry key. Use the "Defaults" dialog to modify the default settings for all console sessions, which are persisted in the root key "HKCU\Console".

Getting it to allocate the console session within a Windows Terminal session is a separate problem.

@eryksun commented on GitHub (Jun 5, 2020): The console codepage can be customized based on the initial window title that's set by `lpTitle` in the process `STARTUPINFO`. Create a subkey for the initial window title that contains the "CodePage" value that you want. For example, if the title is "Simple Chinese": ``` reg add "HKCU\Console\Simple Chinese" /v CodePage /d 936 /t REG_DWORD ``` You can pass the title to use as the first quoted string in the `start` command. For example: ``` start "Simple Chinese" ``` This will open a new instance of cmd.exe that's attached to a new console session in which the active codepage is 936. The "Properties" dialog in this case will persist most settings in the "Simple Chinese" registry key. Use the "Defaults" dialog to modify the default settings for all console sessions, which are persisted in the root key "HKCU\Console". Getting it to allocate the console session within a Windows Terminal session is a separate problem.
Author
Owner

@DHowett commented on GitHub (Jun 5, 2020):

@eryksun I was sure that we had support for this but when I went looking through our code I just couldn’t find it. Thanks.

@DHowett commented on GitHub (Jun 5, 2020): @eryksun I was sure that we had support for this but when I went looking through our code I just couldn’t find it. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8749