Files
Nim/lib/std
Håvard Mjaavatten ae876a4453 Add use of Windows Wide CRT API for env. vars
Replaces use of CRT API `getenv` and `putenv` with respectively
`_wgetenv` and `_wputenv`. Motivation is to reliably convert environment
variables to UTF-8, and the wide API is best there, because it's
reliably UTF-16.

Changed the hack in `lib/std/private/win_setenv.nim` by switching the
order of the Unicode and MBCS environment update; Unicode first, MBCS
second. Because `_wgetenv`/`_wputenv` is now used, the Unicode
environment will be initialized, so it should always be updated.

Stop updating MBCS environment with the name of `getEnv`. It's not
necessarily true that MBCS encoding and the `string` encoding is the
same. Instead convert UTF-16 to current Windows code page with
`wcstombs`, and use that string to update MBCS.

Fixes regression in `6b3c77e` that caused `std/envvars.getEnv` or
`std/os.getEnv` on Windows to return non-UTF-8 encoded strings.

Add tests that test environment variables with Unicode characters in
their name or value.
2022-07-25 11:08:28 +02:00
..
2021-02-21 19:53:28 -08:00
2021-07-30 12:05:14 +02:00
2020-11-24 19:06:41 +01:00
2021-03-10 10:39:23 -08:00
2021-03-10 10:39:23 -08:00
2021-02-21 19:53:28 -08:00
2021-10-01 13:57:06 +02:00
2022-06-09 08:27:31 +02:00
2022-02-02 17:10:11 +01:00
2021-02-21 19:53:28 -08:00