Skip to content

Print Chinese(BIG5) text#1072

Open
ronaldemo wants to merge 3 commits into
mike42:developmentfrom
ronaldemo:development
Open

Print Chinese(BIG5) text#1072
ronaldemo wants to merge 3 commits into
mike42:developmentfrom
ronaldemo:development

Conversation

@ronaldemo

Copy link
Copy Markdown

There are 2 different encodings for Chinese text: GBK (Simplified Chinese) and BIG5 (Traditional Chinese). It is required to allow the developers to define which encoding is used in order to produce correct printing.

@honginho

Copy link
Copy Markdown

Same here~ I need this patch as well.

@imfulee

imfulee commented Aug 30, 2024

Copy link
Copy Markdown

Would like to see this patch go through + 1

@mike42

mike42 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Two things:

  • Can I please get some more information about what model of printer you are using? Example strings you are trying to print are also helpful. This enables finding documentation and keeping test cases for hardware which I don't physically have access to for testing, as otherwise it is very difficult to update the code.
  • Passing any encoding name to the intl extension is too broad. I would be happy to ship an enum/restricted selection of Chinese encodings which we map internally to names used by the extension. The issue is that I may need to replace the intl extension one day, and the behaviour is easy to preserve/test if it only does a few things.

@imfulee

imfulee commented Jul 3, 2026

Copy link
Copy Markdown

I don't particularly remember which printer I was working on for my company back then. Kind of looks like Xprinter XP-S300N

ronaldemo added 2 commits July 8, 2026 11:07
Create a strongly-typed enum for supported Chinese character encodings for ESC/POS printers. Update the Printer::textChinese method to use the enum instead of loose string parameters, improving type safety and code maintainability. Adjust the transcoding call to use the enum's string value.
@ronaldemo

Copy link
Copy Markdown
Author

@mike42 I added the ChineseEncoding enum and updated the textChinese method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants