mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 18:13:28 +07:00
fix: #44 Fixed an issue where exporting presets with non latin 1 character was impossible.
This commit is contained in:
parent
ef35ffe128
commit
22554b41dc
@ -7,7 +7,7 @@ function preset_export() {
|
|||||||
var presets = settings.get('presets');
|
var presets = settings.get('presets');
|
||||||
|
|
||||||
presets = JSON.stringify(presets);
|
presets = JSON.stringify(presets);
|
||||||
modalTextArea.innerHTML = btoa(presets);
|
modalTextArea.innerHTML = btoa(unescape(encodeURIComponent(presets)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,9 +18,9 @@ function preset_import() {
|
|||||||
const settings = require('electron-settings');
|
const settings = require('electron-settings');
|
||||||
var currentPresets = settings.get('presets');
|
var currentPresets = settings.get('presets');
|
||||||
var presetsToBeImported;
|
var presetsToBeImported;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
presetsToBeImported = atob(modalTextArea.value);
|
presetsToBeImported = decodeURIComponent(escape(atob(modalTextArea.value)));
|
||||||
presetsToBeImported = JSON.parse(presetsToBeImported);
|
presetsToBeImported = JSON.parse(presetsToBeImported);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
notification('danger', 'Unable to import presets, malformed data.');
|
notification('danger', 'Unable to import presets, malformed data.');
|
||||||
|
Loading…
Reference in New Issue
Block a user