question: public static String stringTo8859_1 ( String str ) throws UnsupportedEncodingException { if ( str == null ) { return "" ; } return new String ( str . getBytes ( "UTF8" ) , "8859_1" ) ; }
target:  Used to convert username-value, passwd or realm to 8859_1 encoding if all chars in string are within the 8859_1 (Latin 1) encoding range.