public static String getEncodingFromLocale ( Locale locale ) { init ( ) ; if ( locale == cachedLocale ) { return cachedEncoding ; } String encoding = null ; /*(String) _localeMap.get(locale.toString()); if (encoding == null) { encoding = (String) _localeMap.get(locale.getLanguage() + "_" + locale.getCountry()); if (encoding == null) { encoding = (String) _localeMap.get(locale.getLanguage()); } }*/ if ( encoding == null ) { //check the com.ibm.wsspi.http.EncodingUtils com . ibm . wsspi . http . EncodingUtils encodingUtils = com . ibm . ws . webcontainer . osgi . WebContainer . getEncodingUtils ( ) ; if ( encodingUtils != null ) { encoding = encodingUtils . getEncodingFromLocale ( locale ) ; } } cachedEncoding = encoding ; cachedLocale = locale ; return encoding ; }
Get the encoding for a passed in locale .