From 3b20e6e2b80c8ef1d933138cb52c71846857330c Mon Sep 17 00:00:00 2001 From: David Luzar Date: Thu, 6 Feb 2020 18:46:26 +0100 Subject: [PATCH] fix decoding imported data from backend (#722) --- src/scene/data.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scene/data.ts b/src/scene/data.ts index 097cd784..8dde96a6 100644 --- a/src/scene/data.ts +++ b/src/scene/data.ts @@ -252,8 +252,7 @@ export async function importFromBackend( buffer, ); // We need to convert the decrypted array buffer to a string - const string = String.fromCharCode.apply( - null, + const string = new window.TextDecoder("utf-8").decode( new Uint8Array(decrypted) as any, ); data = JSON.parse(string);