qt
2020-03-11 本文已影响0人
fffwc
QTextCodec *code = QTextCodec::codecForName("gbk");
QFile file(path);
file.open(QIODevice::ReadOnly);
QByteArray array = file.readAll();
ui->textEdit->setText(code->toUnicode(array));
QTextCodec *code = QTextCodec::codecForName("gbk");
QFile file(path);
file.open(QIODevice::ReadOnly);
QByteArray array = file.readAll();
ui->textEdit->setText(code->toUnicode(array));