解决Twain测试工具设置字符串类型时失败的问题

This commit is contained in:
yangjiaxuan 2024-02-22 10:13:42 +08:00
parent f7a9c3f104
commit f9112d5179
1 changed files with 8 additions and 8 deletions

View File

@ -471,23 +471,23 @@ HGCapValue MainWindow::getHGCapValue()
} }
else if (capType == "TWTY_STR32") else if (capType == "TWTY_STR32")
{ {
value.type = HGCAPVALUE_TYPE_BYTE; value.type = HGCAPVALUE_TYPE_STR32;
strcpy(value.valueStr32, ui->lineEdit_setCapContent->text().toStdString().c_str()); strcpy(value.valueStr32, ui->lineEdit_setCapContent->text().toLocal8Bit().toStdString().c_str());
} }
else if (capType == "TWTY_STR64") else if (capType == "TWTY_STR64")
{ {
value.type = HGCAPVALUE_TYPE_BYTE; value.type = HGCAPVALUE_TYPE_STR64;
strcpy(value.valueStr64, ui->lineEdit_setCapContent->text().toStdString().c_str()); strcpy(value.valueStr64, ui->lineEdit_setCapContent->text().toLocal8Bit().toStdString().c_str());
} }
else if (capType == "TWTY_STR128") else if (capType == "TWTY_STR128")
{ {
value.type = HGCAPVALUE_TYPE_BYTE; value.type = HGCAPVALUE_TYPE_STR128;
strcpy(value.valueStr128, ui->lineEdit_setCapContent->text().toStdString().c_str()); strcpy(value.valueStr128, ui->lineEdit_setCapContent->text().toLocal8Bit().toStdString().c_str());
} }
else if (capType == "TWTY_STR255") else if (capType == "TWTY_STR255")
{ {
value.type = HGCAPVALUE_TYPE_BYTE; value.type = HGCAPVALUE_TYPE_STR255;
strcpy(value.valueStr255, ui->lineEdit_setCapContent->text().toStdString().c_str()); strcpy(value.valueStr255, ui->lineEdit_setCapContent->text().toLocal8Bit().toStdString().c_str());
} }
return value; return value;