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 Text Issue #31

Open
ahmedahel opened this issue Nov 19, 2020 · 35 comments
Open

Arabic Text Issue #31

ahmedahel opened this issue Nov 19, 2020 · 35 comments

Comments

@ahmedahel
Copy link

Hi Dear,

I'm trying to print receipt in Arabic language but the text some times appear as Inverse and dashed
My Printer Model is : TM-m30 .
Table Code WPC1256 , PC864 and PC720 .
CharsetConverter: cp864, windows-1256.

I get these code from https://reference.epson-biz.com/modules/ref_charcode_en/index.php?content_id=47.

@jacobokoenig
Copy link

@ahmedahel how are you encoding the text? Can you share some code?

@ahmedahel
Copy link
Author

ahmedahel commented Nov 30, 2020

Uint8List encoded =
await CharsetConverter.encode('windows-1256', "فاتورة ضريبة");
printer.textEncoded(encoded,
styles:
PosStyles(codeTable: 'PC850', bold: true, align: PosAlign.center));

@s2yed
Copy link

s2yed commented Jan 12, 2021

I have the same problem with printing

@ahmedahel
Copy link
Author

ahmedahel commented Feb 14, 2021

@andrey-ushakov Is there any updates ?

@s2yed
Copy link

s2yed commented Feb 17, 2021

Is there any updates ?

@xSuperMu
Copy link

I'm facing the same issue!

@xSuperMu
Copy link

which version of the esc_pos_utils do you use?

@xSuperMu
Copy link

Uint8List encoded =
await CharsetConverter.encode('windows-1256', "فاتورة ضريبة");
printer.textEncoded(encoded,
styles:
PosStyles(codeTable: 'PC850', bold: true, align: PosAlign.center));

I've tested this code and it printed different characters!
would you please provide a complete example?

@ahmedahel
Copy link
Author

const PaperSize paper = PaperSize.mm80;
final profile = await CapabilityProfile.load();
final printer = NetworkPrinter(paper, profile);
final PosPrintResult res = await printer.connect(printerIp, port: 9100);

if(res == PosPrintResult.success ){
Uint8List encoded = await CharsetConverter.encode('windows-1256', "فاتورة ضريبة");
printer.textEncoded(encoded,styles:PosStyles(codeTable: 'PC850', bold: true, align: PosAlign.center));
printer.feed(1);
printer.cut();

}

@ahmedahel
Copy link
Author

@jacobokoenig please update us as soon as possible

@nicks258
Copy link

nicks258 commented Jan 8, 2022

Any updates? Facing same issue.

@bluemix
Copy link

bluemix commented Feb 21, 2022

I hope there are updates to this issue

@alasriaj
Copy link

Yes, I faced the same problem
I hope there are updates to this issue

@bluemix
Copy link

bluemix commented Feb 25, 2022

see this solution:

kakzaki/blue_thermal_printer#82 (comment)

@iyashiyas
Copy link

@jacobokoenig please update us as soon as possible

any solution ? still i have issue

@bluemix
Copy link

bluemix commented May 22, 2022

@iyashiyas go to the printer settings, and then set the printing encoding to UTF-8

@iyashiyas
Copy link

@bluemix still not working,
const characterSet = 'CP1256';

    Uint8List encSeller =
        await CharsetConverter.encode(characterSet, "عمل الطباعة العربية");

    bytes += ticket.textEncoded(encSeller,
        styles: const PosStyles(
          height: PosTextSize.size2,
          width: PosTextSize.size2,
          align: PosAlign.center,
          bold: true,
        ));

my printer is epson tm m-30

@iyashiyas
Copy link

see this solution:

kakzaki/blue_thermal_printer#82 (comment)

i have done same this but issue is image printing slowly. it is only a temporary solution the large data will not print.

@bluemix
Copy link

bluemix commented May 29, 2022

in printer settings, i mean, the Android settings of the device.
@iyashiyas

@iyashiyas
Copy link

@bluemix no use.. there is no option to change

@AbdurrahmanElrayes
Copy link

You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation.

image

And this is what I did and it printed arabic perfectly

final encodedStr = utf8Encoder.convert(invoice.description);
bytes += generator.textEncoded(Uint8List.fromList([
  ...[0x1C, 0x26, 0x1C, 0x43, 0xFF],
  ...encodedStr
]))

@mfrouh
Copy link

mfrouh commented Jun 1, 2022

Thank you @AbdurrahmanElrayes for the effort!

@SohybBinselm
Copy link

Thank you so much, this is the only solution that worked for me. @AbdurrahmanElrayes

@sgsm74
Copy link

sgsm74 commented Nov 23, 2022

You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation.

image

And this is what I did and it printed arabic perfectly

final encodedStr = utf8Encoder.convert(invoice.description);
bytes += generator.textEncoded(Uint8List.fromList([
  ...[0x1C, 0x26, 0x1C, 0x43, 0xFF],
  ...encodedStr
]))

not working for me. it still printing Chinese characters

@AbdurrahmanElrayes
Copy link

You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation.
image
And this is what I did and it printed arabic perfectly

final encodedStr = utf8Encoder.convert(invoice.description);
bytes += generator.textEncoded(Uint8List.fromList([
  ...[0x1C, 0x26, 0x1C, 0x43, 0xFF],
  ...encodedStr
]))

not working for me. it still printing Chinese characters

What printer do you use?

@sgsm74
Copy link

sgsm74 commented Nov 23, 2022

You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation.
image
And this is what I did and it printed arabic perfectly

final encodedStr = utf8Encoder.convert(invoice.description);
bytes += generator.textEncoded(Uint8List.fromList([
  ...[0x1C, 0x26, 0x1C, 0x43, 0xFF],
  ...encodedStr
]))

not working for me. it still printing Chinese characters

What printer do you use?

SRP-330ii and an inbuilt printer(Citaq H10 POS)

@AbdurrahmanElrayes
Copy link

image

You can try this command and set the code page to 22 or 40 for arabic characters. That's what the printer manuals says. you can find it in this pdf page 47: [https://data2.manualslib.com/pdf7/272/27101/2710088-bixolon/srp330ii.pdf?744f2c5cdecdd9e0c41f9ce36783ab22](url)

@sgsm74

@sgsm74
Copy link

sgsm74 commented Nov 23, 2022

image

You can try this command and set the code page to 22 or 40 for arabic characters. That's what the printer manuals says. you can find it in this pdf page 47: https://data2.manualslib.com/pdf7/272/27101/2710088-bixolon/srp330ii.pdf?744f2c5cdecdd9e0c41f9ce36783ab22
@sgsm74

Thank you so much, what about the other device??do you got anything??I can print on it but It is reversed like:م ا ل س

@AbdurrahmanElrayes
Copy link

image You can try this command and set the code page to 22 or 40 for arabic characters. That's what the printer manuals says. you can find it in this pdf page 47: [https://data2.manualslib.com/pdf7/272/27101/2710088-bixolon/srp330ii.pdf?744f2c5cdecdd9e0c41f9ce36783ab22](url) @sgsm74

Thank you so much, what about the other device??do you got anything??I can print on it but It is reversed like:م ا ل س

You're welcome. Unfortunately, I couldn't find detailed docs about this printer yet.

@hadyk77
Copy link

hadyk77 commented May 7, 2023

You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation.
image
And this is what I did and it printed arabic perfectly

final encodedStr = utf8Encoder.convert(invoice.description);
bytes += generator.textEncoded(Uint8List.fromList([
  ...[0x1C, 0x26, 0x1C, 0x43, 0xFF],
  ...encodedStr
]))

not working for me. it still printing Chinese characters

What printer do you use?

Can you help me with epson tm30 please ?

@imwa5i7
Copy link

imwa5i7 commented May 22, 2023

I tried the above solutions but they didn't work out for me. my Arabic code page is 92. Do I need to change anything in these numbers?
[0x1C, 0x26, 0xM1C, 0x43, 0xFF]

@Ashbuhrz
Copy link

Ashbuhrz commented Jun 9, 2023

I am using bixolon srp-e300 and it's code table is 22. (https://bixolon.com/_upload/manual/Manual_SRP-E300302_Code_Page_english_Ver_1_01.pdf).

but i am still getting some random arabic letters

@s2yed
Copy link

s2yed commented Jun 12, 2023

I tried the above solutions but they didn't work out for me. my Arabic code page is 92. Do I need to change anything in these numbers?

@waqadArshad
Copy link

Hi, it's very easy to support utf8 encoding which would help you print many languages. You just have to add an entry in the default section of capabilities.json and if you don't want to bother with that, you can use my fork:

https://github.com/waqadArshad/esc_pos_utils

as:

  esc_pos_utils:
    git:
      url: https://github.com/waqadArshad/esc_pos_utils.git

and if it fixes your issue, please remember to STAR the repo.

@EmreSURK
Copy link

Hi, it's very easy to support utf8 encoding which would help you print many languages. You just have to add an entry in the default section of capabilities.json and if you don't want to bother with that, you can use my fork:

https://github.com/waqadArshad/esc_pos_utils

as:

  esc_pos_utils:
    git:
      url: https://github.com/waqadArshad/esc_pos_utils.git

and if it fixes your issue, please remember to STAR the repo.

Hi, is it possible to explain more? For example, should we give a specific profile, or how to select the UTF8 you added?

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