QString Str = "我"; QByteArray utf8Str = Str.toUtf8(); // 转换为UTF-8编码 qDebug() << "utf-8-hex:" << utf8Str