Skip to content

Commit

Permalink
fixed utf encoding issue on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
BrookJeynes committed Apr 24, 2024
1 parent 3d0a619 commit 674d7bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/environment.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ pub fn getHomeDir() !std.fs.Dir {
}, .{ .iterate = true });
},
.windows => {
return std.fs.openDirAbsolute(std.process.getenvW("USERPROFILE") orelse {
const utf16 = std.unicode.utf8ToUtf16LeStringLiteral;
return std.fs.openDirAbsoluteW(std.process.getenvW(utf16("USERPROFILE")) orelse {
log.err("Could not find install directory, %USERPROFILE% environment variable is not set", .{});
return error.MissingHomeEnvironmentVariable;
}, .{ .iterate = true });
Expand Down

0 comments on commit 674d7bf

Please sign in to comment.