QT unicode QByteArray与QString互转

QByteArray array;
array[0] = 0xAA;
QString str = QLatin1String(array);
QString str2 = QString::fromLatin1(array);
qDebug() << array << str << str.toLatin1() << str2.toLatin1() << str2;

打印:"\xAA" "a" "\xAA" "\xAA" "a"

 

posted @ 2020-09-07 17:30  一夜梦想  阅读(706)  评论(0编辑  收藏  举报