Files
Nim/lib
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
..
2017-02-20 17:24:19 +02:00
2021-04-09 16:29:10 +02:00
2022-06-21 09:53:46 +08:00
2022-06-30 23:18:11 +02:00
2021-06-03 14:00:53 +02:00
2021-04-07 23:26:53 +02:00
2021-08-29 09:18:54 +02:00