Skip to content

os: use _wputenv instead of _putenv to stay in sync with _wgetenv (fix changing env variables with non ASCII content on windows)#22920

Merged
spytheman merged 4 commits intovlang:masterfrom
Ekopalypse:master
Nov 20, 2024

Conversation

@Ekopalypse
Copy link
Copy Markdown
Contributor

@Ekopalypse Ekopalypse commented Nov 20, 2024

The use of _wputenv (os.setenv) ensures that environment variables read by _wgetenv (os.getenv) are returned correctly when ACP is used instead of the utf8 code page.

Huly®: V_0.6-21363

Comment thread vlib/builtin/cfns.c.v
@spytheman
Copy link
Copy Markdown
Contributor

Please also add some tests for setting/getting env variables in vlib/os/environment_test.v, that put non ASCII characters in the values.

@spytheman spytheman changed the title os(windows): Use _wputenv instead of _putenv to stay in sync with _wgetenv. os: use _wputenv instead of _putenv to stay in sync with _wgetenv (fix changing env variables with non ASCII content on windows) Nov 20, 2024
@spytheman spytheman merged commit ca67273 into vlang:master Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants