United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8016110 : Japanese char (MS932) 0x5C cannot be used as an argument when quoted

Details
Type:
Bug
Submit Date:
2013-06-06
Status:
Closed
Updated Date:
2014-09-04
Project Name:
JDK
Resolved Date:
2013-09-30
Component:
tools
OS:
windows
Sub-Component:
launcher
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Duplicate:

Sub Tasks

Description
SYNOPSIS
--------
Japanese char (MS932) 0x5C cannot be used as an argument when quoted

OPERATING SYSTEM
----------------
Windows (Japanese)

FULL JDK VERSION
----------------
Java 8
Also reproducible with Java 7 since 7u10.

PROBLEM DESCRIPTION
-------------------
On Japanese Windows, command line argument character will be invalid (U+FFFD) if the following conditions are met.

   1) The argument is enclosed by double quotes.
   2) The last character of the argument is 0x5C. For example, "Katakana So" (0x835C) in MS932.

The problem only occurs if the argument is enclosed by double quotes.
The problem does NOT occur if the argument is enclosed by single quotes.

REPRODUCTION INSTRUCTIONS
-------------------------
1) Setup Japanese Windows.
2) Compile and launch the sample code with Japanese string ended 0x5C code.

   > javac args.java
   > java args "X"

   For example, X is "Katakana So". "Katakana So" is "0x835C" in MS932.

   The problem doesn't occur in the following cases.
   
   > java args X
   > java args 'X'

 FAILING OUTPUT
> ?
> fffd

 EXPECTED OUTPUT
> (Katakana So)
> 30bd
 
TESTCASE
--------
import java.util.*;

public class ArgsTest {
   public static void main(String[] args){
        System.out.println(args[0]);
        for(int i=0; i<args[0].length(); i++){
            System.out.print(Integer.toHexString((int)args[0].charAt(i)));
        }
   }
}


                                    

Comments
SQE OK to take the fix into 7u60.
                                     
2014-03-26
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/b4c259743371
User:  lana
Date:  2013-10-11 18:24:46 +0000

                                     
2013-10-11
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b4c259743371
User:  naoto
Date:  2013-09-30 23:16:51 +0000

                                     
2013-09-30



Hardware and Software, Engineered to Work Together