fix profile export / import to support utf8 / unicode
This commit is contained in:
parent
d2487f1b08
commit
f98b0642c9
3 changed files with 5 additions and 3 deletions
1
app.js
1
app.js
|
|
@ -246,6 +246,7 @@ const script = {
|
|||
"ext/tween",
|
||||
"ext/fsave",
|
||||
"ext/earcut", // work.test
|
||||
"ext/base64",
|
||||
"add/array",
|
||||
"add/three",
|
||||
"geo/base",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
"slicer"
|
||||
],
|
||||
"dependencies": {
|
||||
"base64-js": "^1.5.1",
|
||||
"buffer-crc32": "^0.2.13",
|
||||
"compression": "^1.7.4",
|
||||
"connect": "^3.7.0",
|
||||
|
|
|
|||
|
|
@ -2194,7 +2194,7 @@
|
|||
function settingsImport(data, ask) {
|
||||
if (typeof(data) === 'string') {
|
||||
try {
|
||||
data = JSON.parse(atob(data));
|
||||
data = JSON.parse(new TextDecoder().decode(base64js.toByteArray(data)));
|
||||
} catch (e) {
|
||||
UC.alert('invalid settings format');
|
||||
console.log('data',data);
|
||||
|
|
@ -2269,7 +2269,7 @@
|
|||
const shot = opts.work || opts.screen ? SPACE.screenshot() : undefined;
|
||||
const work = opts.work ? KIRI.codec.encode(WIDGETS,{_json_:true}) : undefined;
|
||||
const view = opts.work ? SPACE.view.save() : undefined;
|
||||
return btoa(JSON.stringify({
|
||||
return base64js.fromByteArray(new TextEncoder().encode(JSON.stringify({
|
||||
settings: settings,
|
||||
version: KIRI.version,
|
||||
screen: shot,
|
||||
|
|
@ -2280,7 +2280,7 @@
|
|||
moto: MOTO.id,
|
||||
init: SDB.getItem('kiri-init'),
|
||||
time: Date.now()
|
||||
}));
|
||||
})));
|
||||
}
|
||||
|
||||
function platformLoadFiles(files,group) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue