code: public static String encode(String unencoded) {
      byte[] bytes = null;
      try {
        bytes = unencoded.getBytes("UTF-8");
      } catch (UnsupportedEncodingException ignored) {}
      if (null == bytes) {
        return null;
      }
      return encode(bytes);
    }
docs: *
  Returns the encoded form of the given unencoded string. The encoder uses the ISO-8859-1
  (Latin-1) encoding to convert the string to bytes. For greater control over the encoding,
  encode the string to bytes yourself and use encode(byte[]).
  
  @param unencoded the string to encode
  @return the encoded form of the unencoded string