Hello everybody,
I face an issue when I tried to print Arabic text using Zebra ZQ220 via Bluetooth, but the printer prints strange symbols.
As a programming language, Dart 2.18.2 is used, and Flutter Framework version 3.3.6 is used as a framework.
The default configuration for Android is as follows:
- minSdkVersion 21
- targetSdkVersion 31
Also, we mainly depend on below packages :
- esc_pos_utils: ^1.1.0
- flutter_pos_printer_platform: ^1.0.12
Can someone please suggest how to overcome this? Regards.
2 Replies
ZQ220 is a CPCL printer model. Make sure the CPCL script for the label prints the Arabic text properly via the USB. Then move the script to the app to print. If the USB prints properly but the app doesn't, then we need to make sure the encoding of the Arabic characters in the app comply with the encoding requirement specified in CPCL.
The printer prints Arabic successfully via USB. but when we send it from the app, it prints strange characters.
we tried two ways to send encoded string :
First:
final arabicText = utf8.encode('شركه هنا');
Uint8List uint8List = Uint8List.fromList(arabicText);
bytes += generator.textEncoded(uint8List);
output in the printer is :
Second:
final List<int> codeUnits = 'شركه هنا'.codeUnits;
final Uint8List unit8List = Uint8List.fromList(codeUnits);
bytes += generator.textEncoded(unit8List);
output in the printer is:
Also, I set the Code page to "CP1252", but this code page works fine in English not Arabic
Thanks very much in advance.