Summary: readf cannot read wchar or dchar from UTF-8 stdin
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos

--- Comment #0 from Ali Cehreli <> 2011-03-16 13:20:54 PDT ---
I compiled the following program with dmd 2.052 on an Ubuntu 10.10 console.

The following program reads only the first code unit instead of the whole

import std.stdio;

void main()
    wchar c;         // Please note: same problem with dchar as well
    readf(" %s", &c);

For example when the input is the character � (encoded with byte values 195 182
in UTF-8), only the first code unit is read and the output becomes the Unicode
character that corresponds to the value of that code unit.

In a sense, the program reads a code unit and outputs it as a code point.

Thank you,

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to