this.char_decoder_ = charset.newDecoder();
this.char_encoder_ = charset.newEncoder();
char_decoder_.onMalformedInput(CodingErrorAction.IGNORE);
char_decoder_.onUnmappableCharacter(CodingErrorAction.IGNORE);
ByteBuffer replacement = charset.encode(BAD_INPUT_REPLACEMENT);
byte[] replace_bytes = new byte[replacement.remaining()];
replacement.get(replace_bytes);
char_encoder_.onMalformedInput(CodingErrorAction.REPLACE);
char_encoder_.onUnmappableCharacter(CodingErrorAction.REPLACE);
char_encoder_.replaceWith(replace_bytes);