So, there is problem in toUTF8 in std.utf "toUTF8(in wchar[] s)".

string cwd()// copied from phobos
{
    writeln("start");
    import core.sys.windows.windows;
    writeln("buff");
    wchar[] ret = new wchar[10240];
    writeln("call");
    auto n = GetCurrentDirectoryW(to!DWORD(ret.length), ret.ptr);
    writeln("return");
    return ret[0 .. n].to!string();
}

Works as expected on both win32 and win64.

Reply via email to