newbie - hey walter, improvement potentials for installer

Sean Kelly sean at
Tue Feb 14 14:02:59 PST 2012

On Feb 14, 2012, at 11:45 AM, Alf P. Steinbach wrote:
> The main problem (pun not intended) in C and C++ is that neither standard `main` nor non-standard Microsoft `WinMain` provide the command line arguments in Unicode. Standard `main` has `char` arguments, by Windows convention encoded in Windows ANSI, which generally means data loss and e.g. that some file names can't be passed. Microsoft `WinMain` provides the arguments part of the command line, in Unicode, but not split up into individual arguments.
> I do not yet know the valid signatures for a D standard `main`.
> But if those D signatures include one with a set of Unicode arguments, then all is super-duper, and if not, then one must just do in D what one must do in C and C++ for a real and standard-conforming program, namely to use the Windows API to retrieve the arguments (if necessary).

D should pass the command-line args as properly translated UTF-8.  If this doesn't happen, consider it a bug.  Regarding Windows specifically, D currently gets the args via GetCommandLineW(), so if that doesn't muck things up then all should be well.

More information about the Digitalmars-d mailing list