Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onMessage(String channel, String sender, String login, String hostname, String message, Dasik bot) {
- Charset charset = Charset.forName("UTF-8");
- CharsetDecoder decoder = charset.newDecoder();
- decoder = decoder.onUnmappableCharacter(CodingErrorAction.REPORT);
- decoder = decoder.onMalformedInput(CodingErrorAction.REPORT);
- try {
- decoder.decode(ByteBuffer.wrap(message.getBytes()));
- } catch (CharacterCodingException ex) {
- bot.send(channel, "Error detected!");
- }
- log.debug("Encoding OK");
- }
Add Comment
Please, Sign In to add comment