Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arabic is not supported #20

Open
Rabeeh96 opened this issue May 24, 2022 · 2 comments
Open

arabic is not supported #20

Rabeeh96 opened this issue May 24, 2022 · 2 comments

Comments

@Rabeeh96
Copy link

E/flutter (16225): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument (string): Contains invalid characters.: "السلام عليكم ورحمة الله وبركاته"
E/flutter (16225): #0 _UnicodeSubsetEncoder.convert (dart:convert/ascii.dart:85:9)
E/flutter (16225): #1 Latin1Codec.encode (dart:convert/latin1.dart:40:46)
E/flutter (16225): #2 Generator._encode (package:esc_pos_utils_plus/src/generator.dart:78:21)
E/flutter (16225): #3 Generator.text (package:esc_pos_utils_plus/src/generator.dart:355:9)
E/flutter (16225): #4 ESCPrinterService.getBytes (package:bluetooth_test/MasterBluetooth/service.dart:68:24)
E/flutter (16225):
E/flutter (16225): #5 _InvoicePrintScreenState._startPrinter (package:bluetooth_test/MasterBluetooth/bluetoothPrint.dart:248:16)
E/flutter (16225):
E/flutter (16225):

@iyashiyas
Copy link

i have tried below codes ..
but still not get anyting.. printing wrong characters.. any one have solutions ?

List byte = [];
// String reversString = reverseString(string);
final Generator ticket = Generator(paper, profile);
// ticket.setGlobalCodeTable('TP806L');
Uint8List encSeller =
await CharsetConverter.encode('ISO-8859-6', string);

      byte += ticket.textEncoded(encSeller,
          styles: const PosStyles(
              height: PosTextSize.size1,
              width: PosTextSize.size1,
              align: PosAlign.center,
              codeTable: 'CP864'));

      printer.rawBytes(byte);

@arbile26
Copy link

I suggest to you writing everything to in HTML then converting the content to image bytes using webcontent_converter package then print the bytes.
I have done this, and it works perfectly with Arabic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants