Skip to content

Sys.environment decodes the Windows environment as UTF-8 #117

Closed

Description

@dimensionscape

On Windows Sys.environment() reads the narrow environ, which is in the ANSI code page, and decodes it as UTF-8, while Sys.getEnv uses the wide API. So after putEnv("X", "café 日本"), getEnv("X") and environment()["X"] differ, and any non-ASCII value (such as a user profile path) is garbled.

Activity

  1. added 2 commits that reference this issue on Oct 15, 2026
    fb461a7
    5d0872a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions