MCPcopy Index your code
hub / github.com/zaproxy/zaproxy / encode

Method encode

zap/src/main/java/org/apache/commons/httpclient/URI.java:1707–1717  ·  view source on GitHub ↗

Encodes URI string. This is a two mapping, one from original characters to octets, and subsequently a second from octets to URI characters: original character sequence->octet sequence->URI character sequence An escaped octet is encoded as a chara

(String original, BitSet allowed,
            String charset)

Source from the content-addressed store, hash-verified

1705 */
1706
1707 protected static char[] encode(String original, BitSet allowed,
1708 String charset) throws URIException {
1709 if (original == null) {
1710 throw new IllegalArgumentException("Original string may not be null");
1711 }
1712 if (allowed == null) {
1713 throw new IllegalArgumentException("Allowed bitset may not be null");
1714 }
1715 byte[] rawdata = URLCodec.encodeUrl(allowed, EncodingUtil.getBytes(original, charset));
1716 return EncodingUtil.getAsciiString(rawdata).toCharArray();
1717 }
1718
1719 /**
1720 * Decodes URI encoded string.

Callers 6

URIMethod · 0.95
parseUriReferenceMethod · 0.95
parseAuthorityMethod · 0.95
setPathMethod · 0.95
setQueryMethod · 0.95
setFragmentMethod · 0.95

Calls 1

getBytesMethod · 0.45

Tested by

no test coverage detected