Boost logo

Boost Users :

Subject: Re: [Boost-users] filesystem::path crash on Windows when dealing with umlauts ( üëï )
From: Gavin Lambert (boost_at_[hidden])
Date: 2019-05-09 02:41:36


On 9/05/2019 00:58, Rainer Deyke wrote:
> Don't use argv[0] on Windows, and generally don't use argv for path
> arguments on Windows.  Any Windows program that uses argv[0] for any
> purpose other than diagnostic output is incorrect.

You can use argv for path arguments, but only if you're using wmain or
wWinMain entry points and using the wchar overloads of Filesystem.

main or WinMain entry points receive ANSI-codepage arguments, which are
guaranteed to not be UTF-8 and are never safe to use as filesystem paths.

> argv[0] is broken on Windows.  Do not use it.

argv[0] is broken everywhere; it can be set fairly arbitrarily by
whoever launches the process, on all platforms.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net