In order to translate some values inside a big JSON (from Italian to Russian) and split it in smaller files, I've created an offline html + Javascript page, in order to to obtain a series of JSON files in a zip (using JSZip). But the Cyrillic strings are not displayed correctly.
The page starts from a JSON stored in a variable, iterates it in order to find certain keys, then reassign the related values with others values taken from an associative array like this:
var translations = {};
translations['Retro Armadio'] = 'Задняя сторона шкафа';
translations['Stagno'] = 'Водонепроницаемый';
translations['Zoccolo'] = 'Цоколь';
The page then stringify the JSON in order to display it in a "pre" Tag and generates the zip file with the splitted JSONs using JSZip:
var zip = new JSZip();
for (const key in bigJSON){
var currentJSON = JSON.stringify(bigJSON[key]);
var currentFileName = key + "-ru.json";
zip.file(currentFileName, currentJSON);
}
Unfortunately both inside the "pre" tag and inside the zip file, the Cyrillic strings are corrupted. I also tried using encodeURIComponent/decodeURIComponent, but I obtain strings like this: "Ð›Ð¸Ñ†ÐµÐ²Ð°Ñ Ñторона шкафа"
To edit the HTML page I'm using Notepad++ in UTF-8. I copy and paste the Cyrillic strings from MS Excel.