I’m developing a protocol for my company using Qt. It is required to query the Window Registry and write the value obtained into a prenegotiated socket. I have read the Registry Data into a QString. I must use 8-bit Unicode characters and for some 16-bit Unicode characters. I am using QByteArray to store all the data before writing to the socket using QTcpSocket::write(). Little Endianness must be followed.
-
How do I get the data from
QStringintoQByteArrayin Unicode 8 bit format (specification says character type corresponds toquint8)? -
How do I get the data from
QStringintoQByteArrayin Unicode 16 bit format (specification says character type corresponds toquint16)? -
How can I maintain Little Endianness in all cases?
(I have no experience of dealing with Unicode/variable-byte-encoded data)
Looking in the documentation is a good start.
0x00FFthen0xFF00.