QT5 Utf-8打印转换

   

QString strText = ui->printContent_TextEdit->toPlainText()+"\n";
QTextCodec* code = QTextCodec::codecForName("GB-2312");
QByteArray ba = code->fromUnicode(strText);
 BOOL bRet =HSSendStrPrn((LPCTSTR)ba.data(),ba.size());

猜你喜欢

转载自blog.csdn.net/gezi322/article/details/108451184
Qt5