浏览代码

fix decoding imported data from backend (#722)

David Luzar 5 年之前
父节点
当前提交
3b20e6e2b8
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/scene/data.ts

+ 1 - 2
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);