lsongdev / lsongdev/node-escpos

UTF8 problem

Open
#385 3 comments 0 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

![image](https://user-images.githubusercontent.com/28803240/161430534-a6555369-0e4d-471b-85f4-fcfb292a85bd.png)
hello everyone, I tried to print a smiley face and Russian letters, nothing comes out. Does anyone have ideas?
i tried also 860, not have result.
Code:
const options = { encoding: "UTF8" };

const printer = new escpos.Printer(device, options);

device.open(function (error) {
printer
.size(0, 0)
.font("a")
.align("ct")
.style("b")
.text("привет андрей ❤️")
.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 by reproducing the reported output with the shown Printer construction and .text("привет андрей ❤️") call, comparing UTF8 and 860 encoding. Trace how the printer driver encodes text before sending it to the device. Done means Cyrillic letters and the smiley produce defined output on the relevant ESC/POS printer, with the supported encoding documented or tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
embedded-iot
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.