code: private static String normalizeUriEscape(byte []rawUri, int i, int len,
                                             String encoding)
      throws IOException
    {
      ByteToChar converter = allocateConverter();
      // XXX: make this configurable
  
      if (encoding == null) {
        encoding = "utf-8";
      }
  
      try {
        converter.setEncoding(encoding);
      } catch (UnsupportedEncodingException e) {
        log.log(Level.FINE, e.toString(), e);
      }
  
      try {
        while (i < len) {
          int ch = rawUri[i++] & 0xff;
  
          if (ch == '%')
            i = scanUriEscape(converter, rawUri, i, len);
          else
            converter.addByte(ch);
        }
  
        String result = converter.getConvertedString();
        
        freeConverter(converter);
        
        return result;
      } catch (Exception e) {
        throw new BadRequestException(L.l("The URL contains escaped bytes unsupported by the {0} encoding.", encoding));
      }
    }
docs: Converts the escaped URI to a string.
  
  @param rawUri the escaped URI
  @param i index into the URI
  @param len the length of the uri
  @param encoding the character encoding to handle %xx
  
  @return the converted URI