Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

UTF-8 not work for thai language (Always print chinese characters)

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
node.js
Domain
embedded-iot

Research direction

Start by reproducing the issue through the escpos.USB device, escpos.Printer options, and the .text("สวัสดี") call shown in the report. Trace how the UTF8 encoding option reaches the printer and compare the emitted data with the printer's Thai character support. Done means Thai text prints as สวัสดี rather than Chinese characters, with a regression check if the project provides one.

Written by the indexing model from the issue text.

Description

I have tried UTF-8 to print the Thai characters but I got Chinese characters instead.

This is my code

const escpos = require("escpos");

escpos.USB = require("escpos-usb");

const device = new escpos.USB();

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();
});

This is the result

IMG_3898

Expected result

Should print สวัสดี in the paper

How to fix it?

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

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.

More from lsongdev/node-escpos

All issues in lsongdev/node-escpos

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.