code: public static String uriEncode(String value, boolean encodeSlash) {
          try {
              StringBuilder builder = new StringBuilder();
              for (byte b : value.getBytes(AipClientConst.DEFAULT_ENCODING)) {
                  if (URI_UNRESERVED_CHARACTERS.get(b & 0xFF)) {
                      builder.append((char) b);
                  } else {
                      builder.append(PERCENT_ENCODED_STRINGS[b & 0xFF]);
                  }
              }
              String encodeString = builder.toString();
              if (!encodeSlash) {
                  return encodeString.replace("%2F", "/");
              }
              return encodeString;
          } catch (UnsupportedEncodingException e) {
              throw new RuntimeException(e);
          }
      }
docs: Normalize a string for use in BCE web service APIs. The normalization algorithm is:
  <ol>
  <li>Convert the string into a UTF-8 byte array.</li>
  <li>Encode all octets into percent-encoding, except all URI unreserved characters per the RFC 3986.</li>
  </ol>
  
  All letters used in the percent-encoding are in uppercase.
  
  @param value the string to normalize.
  @param encodeSlash if encode '/'
  @return the normalized string.