JDK-8016110 : Japanese char (MS932) 0x5C cannot be used as an argument when quoted
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2013-06-06
  • Updated: 2014-10-15
  • Resolved: 2013-09-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u60Fixed 8 b112Fixed
Related Reports
Duplicate :  
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.
26-03-2014