Convert QByteArray to Unicode data



  • Hi All,

    I am working on openssl to decrypt some data. But after i decrypted the content i receive a QByteArray data such as:

    A8\x81\xD1\xC6/\x9A\xF2\xA4\xCA\xB6z\xED\xEF\x0E\xDF\xEF\xAF\xB8\xEA\x03\xAFne\xEF\xFD\xBE\x1D\xD9\x12\xEEz\xCC\xBD\x8B\xDC\x9A\xB1I\xEC\x16\x1D\xAA\xD9R\xBC\xAD\xDA\x8C\xF5\xAD\xEE\xD6\n\xEF\xDF\x8AY\xCB\xBC>\xBD\xC0_o\xBFm\xA5\x8A\xCA\xF6\x01\xAD\xE6\xB5\x0E\x9D\xC9\xFA\xC0\xED""b\x8Dp\xFE\xDC\xFA\xA6\xCD\xD0\xAA\xE5\xEEV\x1B\xBC\xE4\xA3$\xC5?\x9Fq\xB1\xC8\xF6=\xC2\xA2\x01-

    Do you know any way to convert this QByteArray to QByteArray contains Unicode?

    Many thanks.



  • Depends on what the bytearray actually contains but I'd say: http://doc.qt.io/qt-5/qstring.html#fromUtf8-1


Log in to reply
 

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