private static String normalizeUriEscape(byte[] rawUri,int i,int len,String encoding) throws IOException {
  ByteToChar converter=allocateConverter();
  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));
  }
}

private static String normalizeUriEscape ( byte [ ] rawUri , int i , int len , String encoding ) throws IOException { ByteToChar converter = allocateConverter ( ) ; 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 ) ) ; } }
converts the escaped uri to a string .
