-
Bug
-
Resolution: Fixed
-
P2
-
6, 6u21, 6-pool, 7
-
b89
-
generic, x86
-
generic, windows_2000, windows_2003, windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2213209 | 6u30 | Vaibhav Choudhary | P2 | Closed | Fixed | b08 |
JDK-2213148 | 6u29-rev | Vaibhav Choudhary | P2 | Resolved | Fixed | b20 |
JDK-2201766 | 6u27-rev | Vaibhav Choudhary | P2 | Closed | Fixed | b21 |
Name: gm110360 Date: 10/31/2003
FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
I'm trying to invoke a C++ executable from java using the Runtime.exec() method. The C++ application accepts a filename as a command line argument & opens the file. This C++ app is unicode enabled i.e. it can accept UTF-16 (wide char) parameters. However, when i invoke this application using Java's Runtime.exec() and specify a japanese file name as an argument, the japanese characters get converted to '?' characters by the time they are received in the C++ application. I'm running this application on Windows 2K, default i.e. English version.
Looking at the source code of Runtime class, it seems that the exec()
function makes use of a native helper function - execInternal(). This function seems to be converting the parameters from UTF-16 to the system encoding.
I'm more surprised because the VC++ counterpart of this function i.e. CreateProcessW() does work in this case i.e. it is able to invoke an external application with unicode parameters (say with japanese arguments on an English Windows).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Runtime.exec() should be able to invoke external applications with Unicode arguments i.e. the user should be able to pass japanese arguments on an English Windows.
REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 207056)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
I'm trying to invoke a C++ executable from java using the Runtime.exec() method. The C++ application accepts a filename as a command line argument & opens the file. This C++ app is unicode enabled i.e. it can accept UTF-16 (wide char) parameters. However, when i invoke this application using Java's Runtime.exec() and specify a japanese file name as an argument, the japanese characters get converted to '?' characters by the time they are received in the C++ application. I'm running this application on Windows 2K, default i.e. English version.
Looking at the source code of Runtime class, it seems that the exec()
function makes use of a native helper function - execInternal(). This function seems to be converting the parameters from UTF-16 to the system encoding.
I'm more surprised because the VC++ counterpart of this function i.e. CreateProcessW() does work in this case i.e. it is able to invoke an external application with unicode parameters (say with japanese arguments on an English Windows).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Runtime.exec() should be able to invoke external applications with Unicode arguments i.e. the user should be able to pass japanese arguments on an English Windows.
REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 207056)
======================================================================
- backported by
-
JDK-2213148 (process) Runtime.exec() cannot invoke applications with unicode parameters (win)
- Resolved
-
JDK-2201766 (process) Runtime.exec() cannot invoke applications with unicode parameters (win)
- Closed
-
JDK-2213209 (process) Runtime.exec() cannot invoke applications with unicode parameters (win)
- Closed
- duplicates
-
JDK-6927419 Runtime.exec throws IOException when directory parameter contains GB18030 char
- Closed