Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-15656

run qml project in QDS by external tool qml.exe for Qt.btoa () code for Uint8Array will get error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • QDS 4.7.1, QDS 4.7.2
    • All Other Issues
    • None
    • All

      1. Qt.btoa () return Base64 code for Uint8Array  in qml project when running qml by external tool qml.exe
            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=

      1. Mr. Ulf Hermann  have fixed this bug in qt  QML: Declarative and Javascript Engine , PLS refer  QTBUG-135329, but the fix is only for QT.611 , so any new QDS will still  has this bug untill QDS(qml.exe) build by QT6.11
      2. Could QDS team include the fix code to build QDS4.8?

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

            thohartm Thomas Hartmann
            lfj liu fj
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes