Win32: Unicode environment (incoming)
commitf47cf87f366e7e6eb6714ef3b8dfb63616a6ee52
authorKarsten Blees <blees@dcon.de>
Mon, 25 Apr 2011 22:32:27 +0000 (26 00:32 +0200)
committerKarsten Blees <blees@dcon.de>
Thu, 1 Dec 2011 14:57:57 +0000 (1 15:57 +0100)
tree96c48f44892b8da7940961489b8bf4dd7bac5054
parentea8752dc90ffbf59991c2dcfc614c96845f17bfa
Win32: Unicode environment (incoming)

Convert environment from UTF-16 to UTF-8 on startup.

No changes to getenv() are necessary, as the MSVCRT version is implemented
on top of char **environ.

However, putenv / _wputenv from MSVCRT no longer work, for two reasons:
1. they try to keep environ, _wenviron and the Win32 process environment
in sync, using the default system encoding instead of UTF-8 to convert
between charsets
2. msysgit and MSVCRT use different allocators, memory allocated in git
cannot be freed by the CRT and vice versa

Implement mingw_putenv using the env_setenv helper function from the
environment merge code.

Signed-off-by: Karsten Blees <blees@dcon.de>
compat/mingw.c
compat/mingw.h