public String getCharset(Locale locale) {
// ------------------------------------------------------- Public Methods
// Match full language_country_variant first, then language_country,
// then language only
String charset = map.getProperty(locale.toString());
if (charset == null) {
charset = map.getProperty(locale.getLanguage() + "_"
+ locale.getCountry());
if (charset == null) {
charset = map.getProperty(locale.getLanguage());
}
}
return (charset);
}
Calculate the name of a character set to be assumed, given the specified
Locale and the absence of a character set specified as part of the
content type header. |