From 0c6938df444f45a5b9cbe6ec44fcc5df7bcbdb99 Mon Sep 17 00:00:00 2001 From: Berstanio Date: Thu, 14 Dec 2023 22:10:03 +0100 Subject: [PATCH] fix: Enforce UTF-8 for javah to prevent lockup --- .../main/java/com/badlogic/gdx/jnigen/NativeCodeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/NativeCodeGenerator.java b/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/NativeCodeGenerator.java index 7ef5d0f2..8bb5373d 100644 --- a/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/NativeCodeGenerator.java +++ b/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/NativeCodeGenerator.java @@ -301,7 +301,7 @@ private String getNativeClassFileName (FileDescriptor file) { private void generateHFiles (FileDescriptor file) throws Exception { //Use temporary directory to prevent javac from creating class files somewhere we care about. File tempClassFilesDirectory = Files.createTempDirectory("gdx-jnigen").toFile(); - String command = "javac -classpath " + classpath + " -d " + tempClassFilesDirectory.getAbsolutePath() + " -h " + jniDir.path() + " " + file.path(); + String command = "javac -Dfile.encoding=UTF-8 -classpath " + classpath + " -d " + tempClassFilesDirectory.getAbsolutePath() + " -h " + jniDir.path() + " " + file.path(); Process process = Runtime.getRuntime().exec(command); process.waitFor(); if (process.exitValue() != 0) {