question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

USB Printer Encoding Problem with Chinese Characters

See original GitHub issue

thank you for seeing my problem. There is something wrong with my encoding, it occurs that Chinese characters are wrongly printed when I write like this : printer.text("你好") but I get wrong characters printed like “挂批” I tried to set the encoding as #-- coding: gbk – ,but got encoding problem. And I tried to use the magic encode like from escpos.magicencode import Encoder, but got no module named escpos.magicencode as ImportError. So I wander how to set the encoding to make my printer print correct Chinese characters. Sorry for my English and naive questions. I have been working on this for one week and still could’t figure it out. Thanks again.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mike42commented, Feb 25, 2018

Would you mind sharing which make/model of printer you have? This is important, because ESC/POS does not support Chinese text, but some printers have their own commands which you might be able to use.

0reactions
slyang-gitcommented, May 20, 2021

Can I set multiple codepages? Especially for cases where there might be a mixture of traditional and simplified chinese.

maybe you can change codepage by if…else logics on the runtime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

USB Printer Encoding Problem with Chinese Characters
USB Printer Encoding Problem with Chinese Characters. ... There is something wrong with my encoding, it occurs that Chinese characters are wrongly printed...
Read more >
Certain Simplified Chinese characters are not printed properly ...
This issue is caused by GB2312.NCD that it does not cover the full selection of characters mapping that includes traditional Chinese characters.
Read more >
How to print traditional Chinese characters on Epson TM-T20 ...
Problem : Before I use the code provided by jkealey, the printer prints out "?" instead of the Chinese characters, but now it...
Read more >
Chinese charcter display problem in a English Windows 10
This type issue may be related to the settings of the Language for non-Unicode programs. I would suggest you to follow these methods...
Read more >
Thermal printer printing a lot of unwanted characters instea
If everything else prints fine, but chinese letters are a problem, then the issue would be likely fixable in code and related to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found