public static String utf8Encode(String str,String defultReturn){
  if (!isEmpty(str) && str.getBytes().length != str.length()) {
    try {
      return URLEncoder.encode(str,"UTF-8");
    }
 catch (    UnsupportedEncodingException e) {
      return defultReturn;
    }
  }
  return str;
}

public static String utf8Encode ( String str , String defultReturn ) { if ( ! isEmpty ( str ) && str . getBytes ( ) . length != str . length ( ) ) { try { return URLEncoder . encode ( str , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { return defultReturn ; } } return str ; }
encoded in utf - 8 , if exception , return defultreturn
