JDK-4229914 : System.getProperty() can't get Shift-JIS property name from command line.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.2.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1999-04-15
  • Updated: 1999-05-06
  • Resolved: 1999-05-06
Related Reports
Duplicate :  
Description
On Solaris 2.6 with ja_JP.PCK locale,
System.getProperty() can't get the property named by Shift-JIS characters from command line. 

Please compile following program.
And run commands below.

%echo "Expect: �����������������������123"
%java -Dmy.prop=�����������������������123 SysProp my.prop
%echo "Expect: �����������������������123"
%java -D��������prop=�����������������������123 SysProp ��������prop

Shift-JIS property name is not recognized.


====== SysProp.java =============================================================
public class SysProp {
  public static void main(String args[]) {
    System.out.println(System.getProperty(args[0]));
  }
}

=================================================================================



Comments
EVALUATION The command line string is malformed on .java_wrapper level. In other words, /bin/ksh. Under ja_JP.PCK locale, /bin/ksh cannot pass command line argument in Kanji to "$@", where Line 120, invoking java program. [koushi.takahashi@japan 1999-04-19] Problem in '/bin/ksh' under 2.6 ja? Run following shell and program on ja_JP.PCK. run as './ksh_test.sh XXXX YYYY' (set XXXX, YYYY as some kanji string). --- ksh_test.sh #!/bin/ksh -x echo "$@" # option (1) # echo $@ # option (2) # ./args_test "$@" # ./args_test $@ --- arg_test.c #include <stdio.h> int main(int argc, char **argv) { int i; for (i = 0; i < argc; i++) { printf("%d:%s\n", i, argv[i]); } } --- When $@ is double quoted, option (1), Kanji argument is mulformed. option (2) works fine. Log on Solaris 2.6 are attached. Same test runs normal on Solaris 2.7 (even in option (1), double quoted, can pass correct kanji arguments). [koushi.takahashi@japan 1999-04-19] We must use "$@" in .java_wrapper. We can NOT use $@. The former preserves white spaces and the latter doesn't. If we use $@ without the quotes then java Program "argument with space" will become java Program argument with space which is very undesirable. If a bug must be filed it probably should be filed against ksh? anand.palaniswamy@Eng 1999-04-20 Anand, you are right about arguments with quote. My suggested fix does not work on. This was actually fixed on Solaris2.7 ksh. I'll ask documentation team to write this down on 'release note' of cricket as Solaris 2.6 ja limitation. So, Japanese user can aware of. [koushi.takahashi@japan 1999-04-21]
21-04-1999