JDK-4032107 : java.util.Properties class doesn't work for localized properties.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1997-02-13
  • Updated: 1997-05-23
  • Resolved: 1997-05-23
Related Reports
Duplicate :  
Description

Name: mc57594			Date: 02/12/97


Properties#save(OutputStream, String) can't be used for localized
(i.e. Japanese) property values.  There seems to be simple bug in
Properties.java.

--- Properties.java ----
} else {
    prnt.write('\\');
    prnt.write('u');
    prnt.write((ch >> 12) & 0xF);
    prnt.write((ch >>  8) & 0xF);
    prnt.write((ch >>  4) & 0xF);
    prnt.write((ch >>  0) & 0xF);
}
------------------------This should be:
} else {
    prnt.write('\\');
    prnt.write('u');
    prnt.write(Character.forDigit((ch >> 12 & 0xF), 16));
    prnt.write(Character.forDigit((ch >> 8 & 0xF), 16));
    prnt.write(Character.forDigit((ch >> 4 & 0xF), 16));
    prnt.write(Character.forDigit((ch >> 0 & 0xF), 16));
}

Besides, Properties.java includes Runtime#getLocalized??Stream()
and PrintStream class, which is deprecated as of JDK1.1.
To save properties in escaped unicode character, it needs
CharToByte8859_1 conversion, whatever default locale is.

company  -  Nihon Sun Microsystems K.K.  , email  -  ###@###.###
======================================================================

Comments
WORK AROUND Name: mc57594 Date: 02/12/97 ======================================================================
11-06-2004

EVALUATION Didn't <em> I </em> fix this (though not as suggested) for bug 4024062? peter.kessler@Eng 1997-02-13
13-02-1997