Please, help with GoogleApps Script Base 64 Decode
-- Google Apps Script
var tmp_base64 = "EXezAAA=";
var byte_base64 = Utilities.base64Decode(tmp_base64);
return ContentService.createTextOutput('\''+ tmp_base64 + '\' => \''+byte_base64 +'\'' );
return : 'EXezAAA=' => '17,119,-77,0,0'
-- javascript
function _base64ToArrayBuffer(base64) {
var binary_string = window.atob(base64);
var len = binary_string.length;
var bytes = new Uint8Array(len);
for (var i = 0; i < len; i++) {
bytes[i] = binary_string.charCodeAt(i);
}
return bytes;
}
_base64ToArrayBuffer('EXezAAA=');
return : Uint8Array(5) [ 17, 119, 179, 0, 0 ]
correctly converted javascript, but why does Google Apps Script convert to wrong bytes?
How to solve this problem ?