-
Bug
-
Resolution: Fixed
-
P3
-
7u40
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8131305 | 7u40 | Chris Bensen | P3 | Closed | Fixed |
This affects SceneBuilder as well as any self contained FX application which put in place a file association at installation time.
In the case of SceneBuilder the user double clicks an FXML file and thanks the file association the path of the file is put into the parameters array.
Extract of SB's code where I temporarily add the writing of debug.out in order to easier read what comes in:
@Override
public void start(Stage primaryStage) {
String[] args = new String[getParameters().getRaw().size()];
args = getParameters().getRaw().toArray(args);
File out = new File("C:\\debug.out"); // GLOP
try (FileWriter fw = new FileWriter(out, true)) {
fw.write("Default Locale = " + Locale.getDefault() + "\n");
fw.write("args = \n");
for (String item : args) {
fw.write("\t" + item + "\n");
}
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
[...]
When the FXML file path is C:\Documents and Settings\Ken\My Documents\toto.fxml the arguments are correct (see attached debug1.out).
But when I move the FXML file to C:\Documents and Settings\Ken\My Documents\新建文件夹\toto.fxml then the arguments list is empty (see attached debug2.out and the screen capture).
I tried on a Chinese Windows XP and the issue might occur as well on other Windows flavors, Linux and MacOS as soon as the locale is Chinese, Japanese and similar.
In the case of SceneBuilder the user double clicks an FXML file and thanks the file association the path of the file is put into the parameters array.
Extract of SB's code where I temporarily add the writing of debug.out in order to easier read what comes in:
@Override
public void start(Stage primaryStage) {
String[] args = new String[getParameters().getRaw().size()];
args = getParameters().getRaw().toArray(args);
File out = new File("C:\\debug.out"); // GLOP
try (FileWriter fw = new FileWriter(out, true)) {
fw.write("Default Locale = " + Locale.getDefault() + "\n");
fw.write("args = \n");
for (String item : args) {
fw.write("\t" + item + "\n");
}
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
[...]
When the FXML file path is C:\Documents and Settings\Ken\My Documents\toto.fxml the arguments are correct (see attached debug1.out).
But when I move the FXML file to C:\Documents and Settings\Ken\My Documents\新建文件夹\toto.fxml then the arguments list is empty (see attached debug2.out and the screen capture).
I tried on a Chinese Windows XP and the issue might occur as well on other Windows flavors, Linux and MacOS as soon as the locale is Chinese, Japanese and similar.
- backported by
-
JDK-8131305 Application.getParameters.getRaw returns an empty list as soon as the file path it should convey contains non latin characters
-
- Closed
-
- blocks
-
JDK-8118663 JavaFX Scene Builder1.1 b16 still do not support Chinese path
-
- Resolved
-