Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
win32
Description
Current implementation of Runtime kernel class in DRLVM is unable to handle non-English characters in file names properly. For example you cannot do Runtime.exec() if name of target executable contains Russian letters. Please see the test case below.
hello.c
—
#include <stdio.h>
int main() {
printf("%s\n", "Hello world!");
}
ExecWithLocalizedName.java
—
import java.io.*;
public class ExecWithLocalizedName {
public static void main(String argv[]) throws Exception {
Process proc = Runtime.getRuntime().exec(argv[0]);
InputStreamReader reader = new InputStreamReader(proc.getInputStream());
StringBuilder sb = new StringBuilder();
int c;
while ((c = reader.read()) != -1)
{ sb.append((char) c); }reader.close();
System.out.println(sb.toString());
}
}
Compile everything (in MSVC environment):
cl hello.c -o здрасте.exe
javac ExecWithLocalizedName.java
If executed on J9 (or RI):
%J9_HOME%\bin\java ExecWithLocalizedName здрасте.exe
Hello world!
If executed on DRLVM:
%DRLVM_HOME%\bin\java ExecWithLocalizedName здрасте.exe
Uncaught exception in main:
java.io.IOException: The creation of the Process has just failed: "чфЁрёЄх.exe"
at java.lang.Runtime$SubProcess.execVM(Runtime.java:327)
at java.lang.Runtime.exec(Runtime.java:641)
at java.lang.Runtime.exec(Runtime.java:584)
at java.lang.Runtime.exec(Runtime.java:543)
at ExecWithLocalizedName.main(ExecWithLocalizedName.java:5)
Attachments
Issue Links
- relates to
-
HARMONY-4896 [classlib] Classes can't be loaded from a cyrillic path
- Open
-
HARMONY-4876 [drlvm][classloader] unable to load class with non-ASCII character in name
- Open