std.file and non-English filename in Windows

tipdbmp email at example.com
Mon Jan 1 17:24:07 UTC 2018


I think you have to decode your input to UTF-8.

stdin
.byLineCopy(No.keepTerminator)
.each!((string file_name_raw) {

     // change Latin1String to the code page of your console;
     // use the 'chcp' command to see the current code page of 
your console
     //
     import std.encoding;
     auto raw = cast(immutable( Latin1String)[]) file_name_raw;
     string file_name_utf8;
     transcode(raw, file_name_utf8);

     writefln("%s --> %s", file_name_utf8, file_name_utf8.exists);
});



More information about the Digitalmars-d-learn mailing list