aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-07-16 11:15:08 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-07-16 11:15:08 -0400
commit48c474ed3ab7e83bd833cca2dd01b04981d4e953 (patch)
tree2dc963a9a908d500c03303e6fcd4a88f014e57c2 /src
parent75540a3dd4ac330ed710b150c6ec42114d030759 (diff)
Fix non-8bit string export problem
Diffstat (limited to 'src')
-rw-r--r--src/services/export_import/export_import.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/services/export_import/export_import.js b/src/services/export_import/export_import.js
index ac67cf9c..7fee0ad3 100644
--- a/src/services/export_import/export_import.js
+++ b/src/services/export_import/export_import.js
@@ -1,9 +1,11 @@
+import utf8 from 'utf8'
+
export const newExporter = ({
filename = 'data',
getExportedObject
}) => ({
exportData () {
- const stringified = JSON.stringify(getExportedObject(), null, 2) // Pretty-print and indent with 2 spaces
+ const stringified = utf8.encode(JSON.stringify(getExportedObject(), null, 2)) // Pretty-print and indent with 2 spaces
// Create an invisible link with a data url and simulate a click
const e = document.createElement('a')