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

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from [email protected] ---
For -m32 (DIGITAL_MARS_STDIO) it seems to come down to this (with `chcp 65001`
in the console):

----
import std.stdio;

void main()
{
    FILE* fps = core.stdc.stdio.stdin;
    FLOCK(fps);
    scope(exit) FUNLOCK(fps);

    auto fp = cast(_iobuf*)fps;
    assert(!(__fhnd_info[fp._file] & FHND_WCHAR)); /* passes; no wide
characters */
    assert(!(fp._flag & _IOTRAN)); /* passes; no translated mode */

    int c = FGETC(fp);
    assert(c != -1); /* passes with 'a'; fails with 'ä' */
}
----

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.

--

Reply via email to