From a17355e6676aa7bd1ea34cb9f33f99311cffbd77 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Thu, 17 Dec 2015 14:16:31 +0100 Subject: [PATCH] Fixes display of unicode characters in the terminal --- client/app/scripts/components/terminal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/app/scripts/components/terminal.js b/client/app/scripts/components/terminal.js index 3594c4bc3..d87ff6774 100644 --- a/client/app/scripts/components/terminal.js +++ b/client/app/scripts/components/terminal.js @@ -23,7 +23,10 @@ const MDASH = '\u2014'; const reconnectTimerInterval = 2000; function ab2str(buf) { - return String.fromCharCode.apply(null, new Uint8Array(buf)); + // http://stackoverflow.com/questions/17191945/conversion-between-utf-8-arraybuffer-and-string + const encodedString = String.fromCharCode.apply(null, new Uint8Array(buf)); + const decodedString = decodeURIComponent(escape(encodedString)); + return decodedString; } function terminalCellSize(wrapperNode, rows, cols) {