From 3a47fc387a590bd48b2f71e840c38d019331e7c0 Mon Sep 17 00:00:00 2001 From: YtCsj Date: Wed, 9 Dec 2020 00:52:40 +0800 Subject: [PATCH] bug fix, see #112013 (#112015) * bug fix, see #112013 * Update dom.ts fix 1.51.0 new multibyteAwareBtoa function, see # #112013 * Update dom.ts format document --- src/vs/base/browser/dom.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 283b8c82130..da960104877 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -1400,7 +1400,12 @@ function toBinary(str: string): string { for (let i = 0; i < codeUnits.length; i++) { codeUnits[i] = str.charCodeAt(i); } - return String.fromCharCode(...new Uint8Array(codeUnits.buffer)); + let binary = ''; + const uint8array = new Uint8Array(codeUnits.buffer); + for (let i = 0; i < uint8array.length; i++) { + binary += String.fromCharCode(uint8array[i]); + } + return binary; } /**