r25085 by jghali - #16786: QR code generated by "Insert Barcode" could not show CJK characters correctly

scribus-commit scribus-commit at lists.scribus.net
Sun May 1 21:50:17 UTC 2022


Author: jghali
Date: Sun May  1 21:50:17 2022
New Revision: 25085

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25085
Log:
#16786: QR code generated by "Insert Barcode" could not show CJK characters correctly

Modified:
    trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25085&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	(original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	Sun May  1 21:50:17 2022
@@ -819,7 +819,10 @@
 				"end\n"
 				);
 	QString comm("20 10 moveto <%1> <%2> /%3 /uk.co.terryburton.bwipp findresource exec\n");
-	QString bcdata(ui.codeEdit->text().toLatin1().toHex());
+	QByteArray bcLatin1 = ui.codeEdit->text().toLatin1();
+	QByteArray bcUtf8 = ui.codeEdit->text().toUtf8();
+	QByteArray bcArray = (bcLatin1 != bcUtf8) ? ("\xef\xbb\xbf" + bcUtf8) : bcLatin1;
+	QString bcdata(bcArray.toHex());
 	QString bcopts(opts.toLatin1().toHex());
 	comm = comm.arg(bcdata, bcopts, map[ui.bcCombo->currentText()].command);
 	psCommand.append(comm);




More information about the scribus-commit mailing list