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 - ###@###.###
======================================================================
- duplicates
-
JDK-4035543 Properties.load() doesn't work correctly against multi-byte character strings.
-
- Closed
-