/** * Create a new URI decoding filter configured for the specified charset. * * @param input The input token stream * @param charsetEncoding The name of a supported character encoding. * @throws UnsupportedCharsetException if the character encoding is not supported or recognised. */ public URIDecodingFilter(final TokenStream input, final String charsetEncoding) throws UnsupportedCharsetException { super(input); final Charset charset = this.lookupCharset(charsetEncoding); charsetDecoder = charset.newDecoder() .onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE); termAtt = this.addAttribute(CharTermAttribute.class); posIncrAtt = this.addAttribute(PositionIncrementAttribute.class); termBuffer = CharBuffer.allocate(256); }