lsongdev / lsongdev/node-escpos

encode arabic letters

Open
#130 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.6k
Forks
443
PR merge metrics
No merged PRs in 30d

Description

i try to print arabic letters but it always gives me unknown results

like question marks or other depending on type of encode that i pass to .encode function

i try UTF-8 and different types of char encodes

Printer : GP-L80250I

the Code:

'use strict';
var escpos = require('escpos');
var iconv = require('iconv-lite');
var device = new escpos.USB();
var options = { encoding: "UTF-8" /* default */ }
const printer = new escpos.Printer(device,options);
device.open(function(err){
if(err) throw err;
printer.model('qsprinter')
.font('a')
.align('RT')
.size(1, 1)
.text('تجربة الترميز')
.text(iconv.encode('تجربة الترميز' , 'UTF-8'))
.cut()
.close()
});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Node.js example, especially the Printer options, .text() calls, iconv.encode(), and GP-L80250I model. Investigate how the driver handles UTF-8 and printer character encodings; done means Arabic text prints correctly on the named printer rather than as question marks or unknown characters.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
embedded-iot, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.