Win32: Unicode arguments and environment
Convert command line arguments and environment from UTF-16 to UTF-8 on
startup, and vice versa when creating other processes.
Provide replacements for getenv/putenv/unsetenv that operate directly on
the UTF-8-encoded "environ" array to save UTF-8/16 conversions on each
call (and save the trouble to keep track of conversion memory). As sorting
the environment is required for CreateProcess anyway, keep "environ"
sorted and use binary search for faster lookups.
The mingw_startup function converts the command line and environment to
UTF-8, and fixes Windows specific environment settings (TMPDIR and TERM,
formerly handled in mingw_getenv).
Altering the environment when creating new processes is now handled in
spawnv* internally, replacing make_augmented_environ and related APIs.
Signed-off-by: Karsten Blees <blees@dcon.de>