1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Translation tools improvements.

This commit is contained in:
Ylian Saint-Hilaire 2020-01-07 15:10:12 -08:00
parent 3582c7b409
commit a9259feee7
7 changed files with 8334 additions and 8283 deletions

View file

@ -90,8 +90,14 @@ function decode_utf8(s) { return decodeURIComponent(escape(s)); }
function data2blob(data) {
var bytes = new Array(data.length);
for (var i = 0; i < data.length; i++) bytes[i] = data.charCodeAt(i);
var blob = new Blob([new Uint8Array(bytes)]);
return blob;
return new Blob([new Uint8Array(bytes)]);
}
// Convert a UTF8 string into a blob
function utf2blob(str) {
var bytes = [], utf8 = unescape(encodeURIComponent(str));
for (var i = 0; i < utf8.length; i++) { bytes.push(utf8.charCodeAt(i)); }
return new Blob([new Uint8Array(bytes)]);
}
// Generate random numbers