jodd-core/src/main/java/jodd/net/URLCoder.java
public static String encodeHttpUrl(final String httpUrl, final String encoding) {
		Matcher m = HTTP_URL_PATTERN.matcher(httpUrl);
		if (m.matches()) {
			String scheme = m.group(1);
			String authority = m.group(2);
			String userinfo = m.group(4);
			String host = m.group(5);
			String portString = m.group(7);
			String path = m.group(8);
			String query = m.group(10);

			return encodeUriComponents(scheme, authority, userinfo, host, portString, path, query, null, encoding);
		}
		throw new IllegalArgumentException("Invalid HTTP URL: " + httpUrl);
	}
public static String encodeHttpUrl(final String httpUrl, final String encoding) {
		Matcher m = HTTP_URL_PATTERN.matcher(httpUrl);
		if (m.matches()) {
			String scheme = m.group(1);
			String authority = m.group(2);
			String userinfo = m.group(4);
			String host = m.group(5);
			String portString = m.group(7);
			String path = m.group(8);
			String query = m.group(10);

			return encodeUriComponents(scheme, authority, userinfo, host, portString, path, query, null, encoding);
		}
		throw new IllegalArgumentException("Invalid HTTP URL: " + httpUrl);
	}
public static String encodeHttpUrl ( final String httpUrl , final String encoding ) { Matcher m = HTTP_URL_PATTERN . matcher ( httpUrl ) ; if ( m . matches ( ) ) { String scheme = m . group ( 1 ) ; String authority = m . group ( 2 ) ; String userinfo = m . group ( 4 ) ; String host = m . group ( 5 ) ; String portString = m . group ( 7 ) ; String path = m . group ( 8 ) ; String query = m . group ( 10 ) ; return encodeUriComponents ( scheme , authority , userinfo , host , portString , path , query , null , encoding ) ; } throw new IllegalArgumentException ( "Invalid HTTP URL: " + httpUrl ) ; }
Encodes the given HTTP URI into an encoded String. All various URI components are
encoded according to their respective valid character sets.
<p>This method does <b>not</b> support fragments ({@code #}),
as these are not supposed to be sent to the server, but retained by the client.
<p>This method does <b>not</b> attempt to encode "=" and "{@literal &}"
characters in query parameter names and query parameter values because they cannot
be parsed in a reliable way.
Encodes the given HTTP URI into an encoded String . All various URI components are encoded according to their respective valid character sets . <p > This method does <b > not< / b > support fragments ( {