The JS needs to be modified too to make it work. Don’t need to be using atbo / btoa, they both need to be removed to work with Defold’s data. There are other changes which need to be made too but I can’t do right now.
function stringToUint(string) {
var string = unescape(encodeURIComponent(string)),
charList = string.split(''),
uintArray = [];
for (var i = 0; i < charList.length; i++) {
uintArray.push(charList[i].charCodeAt(0));
}
return new Uint8Array(uintArray);
}
function uintToString(uintArray) {
var encodedString = String.fromCharCode.apply(null, uintArray),
decodedString = decodeURIComponent(escape(encodedString));
return decodedString;
}