Commmandline arguments and UTF8 error

Nils Hensel nils.hensel at web.de
Sun Feb 21 09:53:49 PST 2010


Hello, group!

I have a problem writing a small console tool that needs to be given
file names as commandline arguments. Not a difficult task one might
assume. But everytime a filename contains an Umlaut (ä, ö, ü etc.) I
receive "Error: 4invalid UTF-8 sequence".

Here's the sample code:

import std.stdio;

int main(string[] argv)
{
   foreach (arg; argv)
   {
      writef(arg);
   }
   return 0;
}

I use dmd v1.046 by the way.

How do I make the argument valid? I need to be able to use std.path and
 std.file methods on the file names.

Any help would be greatly appreciated.

Regards,
Nils Hensel


More information about the Digitalmars-d-learn mailing list