code: static String encodePath(String content, Charset charset) {
          final StringBuilder buf = new StringBuilder();
          final ByteBuffer bb = charset.encode(content);
          while (bb.hasRemaining()) {
              final int b = bb.get() & 0xff;
              if (PATHSAFE.get(b)) {
                  buf.append((char) b);
              } else {
                  buf.append("%");
                  final char hex1 = Character.toUpperCase(Character.forDigit((b >> 4) & 0xF, RADIX));
                  final char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF, RADIX));
                  buf.append(hex1);
                  buf.append(hex2);
              }
          }
          return buf.toString();
      }
docs: /* from https://github.com/apache/httpcomponents-client/commit/b58e7d46d75e1d3c42f5fd6db9bd45f32a49c639#diff-a74b24f025e68ec11e4550b42e9f807d