Skip to content

Commit

Permalink
Use Unicode variant of GetTempPathW to set java.io.tmpdir system pr…
Browse files Browse the repository at this point in the history
…operty
  • Loading branch information
WojciechMazur committed Jun 1, 2021
1 parent 085ee7e commit ce35129
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions javalib/src/main/scala/java/lang/System.scala
Expand Up @@ -53,9 +53,9 @@ object System {
sysProps.setProperty("file.separator", "\\")
sysProps.setProperty("path.separator", ";")
sysProps.setProperty("java.io.tmpdir", {
val buffer = stackalloc[scala.Byte](MAX_PATH)
GetTempPathA(MAX_PATH, buffer)
fromCString(buffer)
val buffer = stackalloc[CChar16](MAX_PATH)
GetTempPathW(MAX_PATH, buffer)
fromCWideString(buffer, StandardCharsets.UTF_16LE)
})

val userLang = fromCString(Platform.windowsGetUserLang())
Expand Down

0 comments on commit ce35129

Please sign in to comment.