Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135329

Qt.btoa () return Base64 code for Uint8Array

    XMLWordPrintable

Details

    • WebAssembly, Windows

    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=

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtqmlteam Qt Qml Team User
            lfj liu fj
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes