I'm currently using QT to send print commands to the Xp-D300H printer. Everything is working fine; I can print English text, images, and QR codes. However, I'm encountering issues with printing Vietnamese text.
My print text functions :
int escpos_printer_text(escpos_printer *printer, QString content,const char *font,const char *type,const char *align)
{
int result = 0;
QTextCodec *isoCodec = QTextCodec::codecForName("UTF-8");
QByteArray byteArray = isoCodec->fromUnicode(content);
result = escpos_printer_raw(printer,byteArray.data(),byteArray.length());
return result;
}
int escpos_printer_raw(escpos_printer *printer, const char * const message, const int len)
{
assert(printer != NULL);
//This function is using for send byte array to printer by Rs232
printer->mRs232Printer->sendData(message,len);
return 0;
}
The printer is functioning normally, but the characters with diacritics are currently displaying incorrectly.
It is result when i print "Hóa đơn bán hàng"

I have tried various encoding schemes. I have also sent the command to select the Vietnamese code page to the printer (0x1b 0x74 0x28). Additionally, I have turned off the '2 byte character' switch on the printer (because when it's on, the output is all in Chinese).