# Make \`std.os.getenv\` always a compile error on Windows · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/bc626e8b896bee26f565a271da7e60b2564ee341)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: bc626e8b896bee26f565a271da7e60b2564ee341

Requested commit: bc626e8b896bee26f565a271da7e60b2564ee341

Commit: bc626e8b896bee26f565a271da7e60b2564ee341

Tree: 6ff887213006e4780180a018eab249d11cddd3b1

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
Make `std.os.getenv` always a compile error on Windows

The _environ variable that is populated when linking libc on Windows does not support Unicode keys/values (or, at least, the encoding is not necessarily UTF-8). So, for Unicode support, _wenviron would need to be used instead. However, this means that the keys/values would be encoded as UTF-16, so they would need to be converted to UTF-8 before being returned by `os.getenv`. This would require allocation which is not part of the `os.getenv` API, so `os.getenv` is not implementable on Windows even when linking libc.

Closes https://github.com/ziglang/zig/issues/8456

```

## Parents

- [c1e94b28a370bdfe40e8e767b82535e248318aa7](https://git.cafe/gitcafe/zig/commit/c1e94b28a370bdfe40e8e767b82535e248318aa7?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/bc626e8b896bee26f565a271da7e60b2564ee341?format=markdown)
