Skip to content

Commit

Permalink
Merge pull request #53 from Berstanio/fix/enforce-utf8-javah
Browse files Browse the repository at this point in the history
fix: Enforce UTF-8 for javah to prevent lockup
  • Loading branch information
PokeMMO committed Dec 18, 2023
2 parents f08af47 + 0c6938d commit 2601113
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2601113

Please sign in to comment.