Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.3, 6.9.0 RC
-
None
Description
Qt.btoa () return Base64 code for Uint8Array
var bytes2 = new Uint8Array([0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x01, 0x00, 0x01, 0x00, 0xF0, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3B]) var binaryString = '' for (var i = 0; i < bytes2.byteLength; i++) { binaryString += String.fromCharCode(bytes2[i]) } console.log(Qt.btoa(binaryString))
Debug: R0lGODdhAQABAMOwAADDvwAAAAAALAAAAAABAAEAAAICRAEAOw==
it is error
run the code on other software and web like " https://www.wetools.com/js-run"
https://base64.guru/developers/javascript/examples/encode-remote-file
just change Qt.batoa to "btoa" console.log(btoa(binaryString))
R0lGODdhAQABAPAAAP8AAAAAACwAAAAAAQABAAACAkQBADs=