169 |
throws UnsupportedEncodingException |
throws UnsupportedEncodingException |
170 |
{ |
{ |
171 |
// First check for an aliased encoding name |
// First check for an aliased encoding name |
172 |
encoding = SystemProperties.getProperty("gnu.java.io.encoding_scheme_alias." + |
encoding = resolveAlias(encoding); |
|
encoding, encoding); |
|
173 |
|
|
174 |
StringTokenizer st = new StringTokenizer(encoding_path, ":"); |
StringTokenizer st = new StringTokenizer(encoding_path, ":"); |
175 |
|
|
189 |
|
|
190 |
/*************************************************************************/ |
/*************************************************************************/ |
191 |
|
|
192 |
|
private static String resolveAlias(String encoding) |
193 |
|
{ |
194 |
|
String prefix = "gnu.java.io.encoding_scheme_alias."; |
195 |
|
// Aliases should preferably be defined in lowercase so that they |
196 |
|
// can be matched case-insensitively, but for compatibility we will |
197 |
|
// first look for an exact match. |
198 |
|
return SystemProperties.getProperty(prefix + encoding, |
199 |
|
SystemProperties.getProperty(prefix + encoding.toLowerCase(), encoding)); |
200 |
|
} |
201 |
|
|
202 |
/** |
/** |
203 |
* This method loads an <code>Encoder</code> class for the given |
* This method loads an <code>Encoder</code> class for the given |
204 |
* encoding name. |
* encoding name. |
209 |
throws UnsupportedEncodingException |
throws UnsupportedEncodingException |
210 |
{ |
{ |
211 |
// First check for an aliased encoding name |
// First check for an aliased encoding name |
212 |
encoding = SystemProperties.getProperty("gnu.java.io.encoding_scheme_alias." + |
encoding = resolveAlias(encoding); |
|
encoding, encoding); |
|
213 |
|
|
214 |
StringTokenizer st = new StringTokenizer(encoding_path, ":"); |
StringTokenizer st = new StringTokenizer(encoding_path, ":"); |
215 |
|
|