Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8248095 | 16 | Alexey Semenyuk | P3 | Resolved | Fixed | team |
ADDITIONAL SYSTEM INFORMATION :
Only appears on Windows systems even my system local is in French
A DESCRIPTION OF THE PROBLEM :
Non-ASCII characters passed as arguments to the native launcher do not match those transmitted to the JVM.
Example of an argument with french chars:
$ app.exe mypath/élément.txt
JVM args => mypath/élément.txt
Therefore it is not possible to open files with non-ASCII characters by associating a mime type to the application.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Create a class FooClient.java, fill with the content below.
2) Add module-info.java:
module app {
requires java.desktop;
}
3) Build app.jar
4) Build an installer: jpackage -n app -p C:\Users\myjarpath\target -m app/org.test.FooClient
5) Install app-1.0.exe
6) From cmd, run: app.exe mypath/élément.txt
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Result in JFrame: mypath/élément.txt
ACTUAL -
Result in JFrame: mypath/élément.txt
---------- BEGIN SOURCE ----------
package org.test;
import java.awt.BorderLayout;
import javax.swing.*;
public class FooClient {
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("Test non ascii chars through args");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
BoxLayout boxLayout = new BoxLayout(panel, BoxLayout.Y_AXIS);
panel.setLayout(boxLayout);
for (int i = 0; i < args.length; i++) {
JLabel jLabel = new JLabel(args[i]);
panel.add(jLabel);
}
frame.getContentPane().add(panel, BorderLayout.CENTER);
frame.pack();
frame.toFront();
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
FREQUENCY : always
Only appears on Windows systems even my system local is in French
A DESCRIPTION OF THE PROBLEM :
Non-ASCII characters passed as arguments to the native launcher do not match those transmitted to the JVM.
Example of an argument with french chars:
$ app.exe mypath/élément.txt
JVM args => mypath/élément.txt
Therefore it is not possible to open files with non-ASCII characters by associating a mime type to the application.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Create a class FooClient.java, fill with the content below.
2) Add module-info.java:
module app {
requires java.desktop;
}
3) Build app.jar
4) Build an installer: jpackage -n app -p C:\Users\myjarpath\target -m app/org.test.FooClient
5) Install app-1.0.exe
6) From cmd, run: app.exe mypath/élément.txt
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Result in JFrame: mypath/élément.txt
ACTUAL -
Result in JFrame: mypath/élément.txt
---------- BEGIN SOURCE ----------
package org.test;
import java.awt.BorderLayout;
import javax.swing.*;
public class FooClient {
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("Test non ascii chars through args");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
BoxLayout boxLayout = new BoxLayout(panel, BoxLayout.Y_AXIS);
panel.setLayout(boxLayout);
for (int i = 0; i < args.length; i++) {
JLabel jLabel = new JLabel(args[i]);
panel.add(jLabel);
}
frame.getContentPane().add(panel, BorderLayout.CENTER);
frame.pack();
frame.toFront();
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8248095 Non-ASCII characters are not handled correctly in the native launcher
-
- Resolved
-
- duplicates
-
JDK-8242074 Double click to open file chokes on special characters and spaces
-
- Closed
-