[Issue 15845] Windows console cannot read properly UTF-8 lines

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Mar 30 14:49:25 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15845

--- Comment #3 from ag0aep6g at gmail.com ---
(In reply to ag0aep6g from comment #2)
> For -m32 (DIGITAL_MARS_STDIO) it seems to come down to this (with `chcp
> 65001` in the console):
[...]
> That is, Digital Mars's FGETC (_fgetc_nlock) returns -1 for non-ASCII
> characters.
> 
> The issue does not manifest with a pipe: `echo รค | test` works.

The same happens with -m64, and with a simple C++ program (just `printf("%d\n",
fgetc(stdin));`). So apparently `chcp 65001` is not enough to make UTF-8 input
work from the console. I'm not much of a Windows programmer, though, so I have
no idea what's missing.

--


More information about the Digitalmars-d-bugs mailing list