New implementation of pseudo console support (experimental)

Thomas Wolff towo@towo.net
Mon Aug 31 16:12:19 GMT 2020



Am 31.08.2020 um 17:56 schrieb Johannes Schindelin:
> Hi Takashi,
>
> On Mon, 31 Aug 2020, Takashi Yano wrote:
>
>> On Mon, 31 Aug 2020 16:22:20 +0200 (CEST)
>> Johannes Schindelin wrote:
>>> On Mon, 31 Aug 2020, Takashi Yano wrote:
>>>
>>>> On Mon, 31 Aug 2020 14:49:04 +0200 (CEST)
>>>> Johannes Schindelin wrote:
>>>>
>>>>> Sorry to latch onto this thread with something slightly different, but we
>>>>> do see pretty serious encoding problems (both with and without
>>>>> `CYGWIN=disable_pcon`) in the Git for Windows and the MSYS2 projects. For
>>>>> example, in https://github.com/msys2/MSYS2-packages/issues/1974 the
>>>>> following issue was reported. If you compile a _MINGW_ program from this
>>>>> source code:
>>>>>
>>>>> -- snip --
>>>>> #include <stdio.h>
>>>>>
>>>>> int main(){
>>>>>    puts("Привет мир! Hello world!");
>>>>>    return 0;
>>>>> }
>>>>> -- snap --
>>>>>
>>>>> and then execute it, you will see this output:
>>>>>
>>>>> -- snip --
>>>>> Привет мир! Hello world!
>>>>> -- snap --
>>>> I guess your program (binary exe) does not work as you expect
>>>> in command prompt as well. If you want to use UTF-8 coding in
>>>> output, you should add SetConsoleOutputCP(CP_UTF8) call befere
>>>> puts().
>>> That may be, but I would like to point out that the very same executable
>>> worked quite well in a MinTTY using v3.0.7...
Assuming the test program source file is encoded in UTF-8 when compiling 
with x86_64-w64-mingw32-gcc, the string would be output byte by byte, 
which happend to be interpreted in UTF-8 when run in a terminal on 
cygwin 3.0.7, although the program was not set up to use UTF-8.
The "correct" output was actually buggy behaviour, so current cygwin has 
"fixed" it, to your disadvantage in this case.
With ConPTY support, matching encoding on Windows and terminal side need 
to be taken care of.
Thomas

>> at the expense of garbled output for apps which use native
>> code page of the system in the correct maner.
> Are you referring to apps that call the SetConsoleOutputCP() function? If
> so, I am asking myself what would be broken. Because apps that do _not_
> call that function (expecting UTF-8 to be active) would be fixed, while
> apps that _do_ call that function would not care if the Cygwin runtime
> changed it.
>
> Ciao,
> Johannes



More information about the Cygwin-developers mailing list