Name: ddT132432 Date: 12/04/2001
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
Currenly the java.util.Properties.load() method looks like:
public synchronized void load(InputStream inStream) throws IOException {
BufferedReader in = new BufferedReader(new
InputStreamReader(inStream, "8859_1"));
while (true) {
// Get next line
String line = in.readLine();
if (line == null)
return;
.
.
.
Suggest that we create another Properties.load() method that looks like:
public synchronized void load(InputStream inStream, String encoding)
throws IOException {
BufferedReader in = new BufferedReader(new
InputStreamReader(inStream, encoding));
while (true) {
// Get next line
String line = in.readLine();
if (line == null)
return;
.
.
.
This will allow for loading of multi-byte property files when the encoding of a
file is known (and the old load method can exist for backward compatabliity with
existing API's and for when the encoding is not known).
(Review ID: 136762)
======================================================================
If you do consider adding this RFE, it might not be a bad idea to also include an additional constructor for java.util.PropertyResourceBundle
that looks like:
public PropertyResourceBundle(InputStream stream, String encoding)
throws IOException {
lookup.load(stream, encoding);
}
.
.
.
###@###.### 2001-12-05
- duplicates
-
JDK-4077980 Properties.save() and Properties.load() are not non-ASCII safe
-
- Closed
-