QByteArray to QString with Binary data



  • Is there anyway to copy/transfer a QByteArray to a QString and still preserve non printable fields? Due to programmatic constraints, I am reading binary data into a QByteArray and that preserves all the data (including embedded 0x00) but am trying to get it through an interface expecting a QString. All my attempts have result in a QString that contains nothing like the QByteArray.


  • Lifetime Qt Champion

    Hi,

    You can convert to base64 and pass that but that means that you need to decode on the other side for further processing.

    Do you have any possibility to modify that other interface ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.