equal
deleted
inserted
replaced
41 |
41 |
42 import java.io.InputStream; |
42 import java.io.InputStream; |
43 import java.io.InputStreamReader; |
43 import java.io.InputStreamReader; |
44 import java.io.Reader; |
44 import java.io.Reader; |
45 import java.io.IOException; |
45 import java.io.IOException; |
46 import java.nio.charset.Charset; |
|
47 import java.nio.charset.MalformedInputException; |
46 import java.nio.charset.MalformedInputException; |
48 import java.nio.charset.StandardCharsets; |
47 import java.nio.charset.StandardCharsets; |
49 import java.nio.charset.UnmappableCharacterException; |
48 import java.nio.charset.UnmappableCharacterException; |
50 import java.security.AccessController; |
49 import java.security.AccessController; |
51 import java.util.Locale; |
50 import java.util.Locale; |
140 public class PropertyResourceBundle extends ResourceBundle { |
139 public class PropertyResourceBundle extends ResourceBundle { |
141 |
140 |
142 // Check whether the strict encoding is specified. |
141 // Check whether the strict encoding is specified. |
143 // The possible encoding is either "ISO-8859-1" or "UTF-8". |
142 // The possible encoding is either "ISO-8859-1" or "UTF-8". |
144 private static final String encoding = |
143 private static final String encoding = |
145 AccessController.doPrivileged( |
144 GetPropertyAction |
146 new GetPropertyAction("java.util.PropertyResourceBundle.encoding", "")) |
145 .getProperty("java.util.PropertyResourceBundle.encoding", "") |
147 .toUpperCase(Locale.ROOT); |
146 .toUpperCase(Locale.ROOT); |
148 |
147 |
149 /** |
148 /** |
150 * Creates a property resource bundle from an {@link java.io.InputStream |
149 * Creates a property resource bundle from an {@link java.io.InputStream |
151 * InputStream}. This constructor reads the property file in UTF-8 by default. |
150 * InputStream}. This constructor reads the property file in UTF-8 by default. |