QByteArray to QString

You can use QTextCodec to convert the bytearray to a string: (1015 is UTF-16, 1014 UTF-16LE, 1013 UTF-16BE, 106 UTF-8) From your example we can see that the string “test” is encoded as “t\0 e\0 s\0 t\0 \0 \0” in your encoding, i.e. every ascii character is followed by a \0-byte, or resp. every ascii character is encoded as 2 bytes. The … Read more