I'm trying to redirect unicode in the windows console, but when redirecting, empty files are created. If i do it without redirects, then the text is displayed correctly in the console:

```d
import core.sys.windows.windows;
import std.stdio;

void main() {
    wstring str = "Just text...";
    HANDLE h_stderr = GetStdHandle(STD_ERROR_HANDLE);
    HANDLE h_stdout = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsoleW(h_stderr, str.ptr, cast(DWORD)str.length, NULL, NULL); WriteConsoleW(h_stdout, str.ptr, cast(DWORD)str.length, NULL, NULL);
}
```

```sh
.\app.exe 1> stdout.txt 2> stderr.txt
```

Reply via email to