public LocaleHandler(String languages,String charsets){
  Locale defaultLocale=new Locale("en","US");
  String defaultCharset="ISO-8859-1";
  if (languages == null) {
    m_chosenLocale=defaultLocale;
    m_chosenCharset=defaultCharset;
    return;
  }
  StringTokenizer langTokenizer=new StringTokenizer(languages,",");
  while (langTokenizer.hasMoreTokens()) {
    String lang=langTokenizer.nextToken();
    Locale loc=getLocaleForLanguage(lang);
    String charset=getCharsetForLocale(loc,charsets);
    if (charset == null)     continue;
    m_chosenLocale=loc;
    m_chosenCharset=charset;
    return;
  }
  m_chosenLocale=defaultLocale;
  m_chosenCharset=defaultCharset;
}

public LocaleHandler ( String languages , String charsets ) { Locale defaultLocale = new Locale ( "en" , "US" ) ; String defaultCharset = "ISO-8859-1" ; if ( languages == null ) { m_chosenLocale = defaultLocale ; m_chosenCharset = defaultCharset ; return ; } StringTokenizer langTokenizer = new StringTokenizer ( languages , "," ) ; while ( langTokenizer . hasMoreTokens ( ) ) { String lang = langTokenizer . nextToken ( ) ; Locale loc = getLocaleForLanguage ( lang ) ; String charset = getCharsetForLocale ( loc , charsets ) ; if ( charset == null ) continue ; m_chosenLocale = loc ; m_chosenCharset = charset ; return ; } m_chosenLocale = defaultLocale ; m_chosenCharset = defaultCharset ; }
constructs a new localehandler language list , and charset list .
