Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/FoundationEssentials/String/String+Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ extension String {
guard GetEnvironmentVariableW(pwszVariable, $0.baseAddress, dwLength) == dwLength - 1 else {
return nil
}
return String(decoding: $0, as: UTF16.self)
return String(decodingCString: $0.baseAddress!, as: UTF16.self)
}
}
}
Expand Down Expand Up @@ -436,7 +436,7 @@ extension String {
guard GetUserProfileDirectoryW(hToken, $0.baseAddress, &dwcchSize) else {
fatalError("unable to query user profile directory")
}
return String(decoding: $0, as: UTF16.self)
return String(decodingCString: $0.baseAddress!, as: UTF16.self)
}
#else
#if targetEnvironment(simulator)
Expand Down
2 changes: 1 addition & 1 deletion Sources/FoundationEssentials/URL/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ public struct URL: Equatable, Sendable, Hashable {
if result.count > 1 && result.utf8.last == UInt8(ascii: "/") {
_ = result.popLast()
}
let charsToLeaveEncoded = Set([UInt8(ascii: "/")])
let charsToLeaveEncoded: Set<UInt8> = [._slash, 0]
return Parser.percentDecode(result, excluding: charsToLeaveEncoded) ?? ""
}

Expand Down