Skip to content

Commit 42ee76b

Browse files
committed
Merge pull request processing#4204 from jdf/master
Fix crashing bugs that happen when the user's name has non-ASCII characters on Windows.
2 parents f529a0b + 7a955fd commit 42ee76b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

app/src/processing/app/Platform.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ static public File getContentFile(String name) {
286286
String decodedPath = PApplet.urlDecode(path);
287287

288288
if (decodedPath.contains("/app/bin")) { // This means we're in Eclipse
289+
final File build = new File(decodedPath, "../../build").getAbsoluteFile();
289290
if (Platform.isMacOS()) {
290-
processingRoot =
291-
new File(path, "../../build/macosx/work/Processing.app/Contents/Java");
291+
processingRoot = new File(build, "macosx/work/Processing.app/Contents/Java");
292292
} else if (Platform.isWindows()) {
293-
processingRoot = new File(path, "../../build/windows/work");
293+
processingRoot = new File(build, "windows/work");
294294
} else if (Platform.isLinux()) {
295-
processingRoot = new File(path, "../../build/linux/work");
295+
processingRoot = new File(build, "linux/work");
296296
}
297297
} else {
298298
// The .jar file will be in the lib folder
@@ -311,7 +311,8 @@ static public File getContentFile(String name) {
311311
System.err.println("Could not find lib folder via " +
312312
jarFolder.getAbsolutePath() +
313313
", switching to user.dir");
314-
processingRoot = new File(System.getProperty("user.dir"));
314+
final String userDir = System.getProperty("user.dir");
315+
processingRoot = new File(PApplet.urlDecode(userDir));
315316
}
316317
}
317318
}

0 commit comments

Comments
 (0)