On Mon, 7 Sep 2020 18:36:59 +0900 Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> wrote: > > This is really confusing me. We never set the console codepage in the > > old pty code before, it was just pipes transmitting bytes. Why do we > > suddenly have to handle native apps running in a console in this case?!? > > This is actually not related to pseudo console. In Japanese environment, > cmd.exe output CP932 string by default. This caused gabled output in old > cygwin such as 3.0.7. The code for the case that pseudo console is > disabled is to fix this.
If your question is "Why is GetConsoleOutputCP() used for non-console handle?", the answer is "I am not sure why, but it affected by codepage". Even with cygwin 3.0.7 which does not support pseudo console, chcp.com works. -- Takashi Yano <takashi.y...@nifty.ne.jp>