MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / encode

Method encode

src/main/java/org/htmlunit/util/UrlUtils.java:365–369  ·  view source on GitHub ↗

Escapes and encodes the specified string. Based on HttpClient 3.1's URIUtil.encode() method. @param unescaped the string to encode @param allowed allowed characters that shouldn't be escaped @param charset the charset to use @return the escaped string

(final String unescaped, final BitSet allowed, final Charset charset)

Source from the content-addressed store, hash-verified

363 * @return the escaped string
364 */
365 private static String encode(final String unescaped, final BitSet allowed, final Charset charset) {
366 final byte[] bytes = unescaped.getBytes(charset);
367 final byte[] bytes2 = encodeUrl(allowed, bytes);
368 return encodePercentSign(bytes2);
369 }
370
371 /**
372 * Encodes every occurrence of the escape character '%' in the given input

Callers 5

encodeUrlMethod · 0.95
encodeAnchorMethod · 0.95
encodeHashMethod · 0.95
encodeQueryMethod · 0.95
encodeQueryPartMethod · 0.45

Calls 3

encodeUrlMethod · 0.95
encodePercentSignMethod · 0.95
getBytesMethod · 0.65

Tested by

no test coverage detected