Fixes display of unicode characters in the terminal

This commit is contained in:
Simon Howe
2015-12-17 14:16:31 +01:00
parent 2faa58aa41
commit a17355e667

View File

@@ -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) {