JDK-8232846 : ProcessHandle.Info command with non-English shows question marks
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 11,14,15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2019-10-23
  • Updated: 2020-07-27
  • Resolved: 2020-03-28
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 11 JDK 13 JDK 15
11.0.10-oracleFixed 13.0.4Fixed 15 b17Fixed
Description
FULL PRODUCT VERSION :
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+17-721)
OpenJDK 64-Bit Server VM (build 14-ea+17-721, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows 10 Japanese

A DESCRIPTION OF THE PROBLEM :
ProcessHandle.Info command shows question mark or garbled characters if the command is in non-English.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the attached sample program in Japanese Windows.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected
C:\Temp\(Japanese Hiragana A x 3).exe

Actual
C:\Temp\????

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.io.*;
import java.nio.*;
import java.nio.file.*;
import java.util.*;

public class ProcessName{
    public static void main(String[] args) {
        try{
            // Create Japanese named program for test
            String test = "\u3042\u3042\u3042.exe"; // Japanese Hiragana AAA
            String systemRoot = System.getenv("SystemRoot");
            Path ping = Paths.get(systemRoot).resolve("system32").resolve("ping.exe");
            Path target = Paths.get(test);
            Files.copy(ping, target, StandardCopyOption.REPLACE_EXISTING);
            Scanner keyboard = new Scanner(System.in);
            System.out.print("Pree enter key:");
            String input = keyboard.nextLine();

            String[] cmd={test, "localhost"};
            ProcessBuilder pb = new ProcessBuilder().command(cmd);
            Process p = pb.start();
            ProcessHandle.Info info = p.info();
            System.out.println(info.command().get());
        }catch(IOException e){
            e.printStackTrace();
        }
    }
}
---------- END SOURCE ---------- 
Comments
Fix request (13u): 13u is also affected by the problem. The original change applies cleanly.
11-06-2020

Thank you again for your support, Christoph.
28-04-2020

Hi [~tnakamura], I'll approve & sponsor this for you, after running through SAP's regression tests. Cheers Christoph
28-04-2020

Fix Request Backporting this patch solves internationalization issue on Windows. The original report of the problem from our customer was for 11, and we'd like to back port this. This patch applies cleanly to 11u. tier1 tests passes with the patch.
22-04-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/b6c4b1bada1c User: rriggs Date: 2020-03-28 23:37:01 +0000
28-03-2020

Added noreg-hard label, since this problem occurs with only Multi-byte character environments, such as Japanese, Korean, Chinese, etc.
26-03-2020