code: public static String urlEncode(final String text) {
          try {
              return URLEncoder.encode(text, StandardCharsets.UTF_8.name());
          } catch (final UnsupportedEncodingException e) {
              final String message = "Unable to encode text : " + text;
              throw new TechnicalException(message, e);
          }
      }
docs: URL encode a text using UTF-8.
  
  @param text text to encode
  @return the encoded text