www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - main() args not UTF-8

import std.stdio;
int main(char[][] args)
{
    writefln("%d args:", args.length);
    foreach(char[] arg; args)
    {
       writefln("\t%s", arg);
    }
    return 0;
}

I compile it to test.exe and do this on the command line:
C:\>test foo bår
3 args:
    C:\test.exe
    foo
    bError: invalid UTF-8 sequence

Note: Windows 9x/Me/NT support GetCommandLineW() so it could be used with  
std.utf.toUTF8().
Dec 17 2004