From e5138ff737738f60cc2ce73f35b98d4b414af8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 25 Jun 2018 23:11:08 +0300 Subject: [PATCH] Also replace DEL with its graphical equivalent --- ircbot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ircbot.js b/ircbot.js index c672356..ce23397 100644 --- a/ircbot.js +++ b/ircbot.js @@ -65,11 +65,14 @@ function ircbotRun(program, input, maxCycles = 400000) { // Replace all characters < 0x20 except for IRC formatting codes // with their graphical representations at U+24xx + // Also replace DEL with U+2421 let formattingChars = [0x02, 0x03, 0x0f, 0x12, 0x15]; output = Array.from(output).map(c => { let codePoint = c.codePointAt(0); if(codePoint < 0x20 && !formattingChars.includes(codePoint)) { return String.fromCodePoint(0x2400 + codePoint); + } else if(codePoint == 0x7f) { + return String.fromCodePoint(0x2421); } else { return c; }