Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4027482

Runtime.exec can't execute a command including non-Latin1(Japanese) characters

XMLWordPrintable

    • generic
    • generic


      masayoshi.okutsu@Eng 1997-01-23
      Sub-process can't be executed if specified executable name consists of
      Japanese characters. Both Solaris and Windows failed.

      To reproduce the problem, execure the following test program (includes
      EUCJIS characters). Note that the path name specified by 'cmd' exists and
      is executable.

      import java.io.*;

      public class exe{
      public static void main(String[] arg){
                  try{
      String cmd = "/home/sishida/bin/㳓›©ýmeow";
      Runtime r = Runtime.getRuntime();
      Process p = r.exec(cmd);
      p.waitFor();
      InputStream in = p.getErrorStream();
      BufferedReader br = new BufferedReader(new InputStreamReader(in));
      System.out.println(br.readLine());
      }catch(Exception e){
      System.out.println(e.getMessage());
      System.out.println("*** NG ***");
      }
      System.out.println("*** OK ***");
      }
      }

      Result:

      sishida@stones[69] java exe
      /home/sishida/bin/?,^^meow: not found
      *** NG ***
      *** OK ***

            nishimur Naoyuki Ishimura (Inactive)
            okutsu Masayoshi Okutsu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: