Chinese cp936 support
See original GitHub issueBug description
Actually this is not a bug, but a question. I am looking to use this lib to print Chinese characters (cp936), has no luck to succeed yet. The platform is beaglebone.
Any help is appreciated.
Steps to reproduce
– I am adding a new printer in the profile:
RD-DH32:
name: RD-DH32
vendor: Rongda Beijing
inherits: default
notes: >
RD-DH32 http://www.rd-cn.com/uploadfile/2015/1029/20151029014450556.pdf.
features:
barcodeB: false
bitImageColumn: true
bitImageRaster: true
graphics: false
qrCode: false
pdf417Code: false
starCommands: True
codePages:
0: CP936
– And provide the magic_encode_args in the printer arguments, such as:
code:: python
magic_encode_args = dict(encoding='cp936')
p = Dummy(profile='RD-DH32', magic_encode_args=magic_encode_args)
p.text(u"荣") # 打印文字
out = p.output
for i in out:
print "0x{0:02x}".format(ord(i))
Looks like I got things incorrect: 0x3f
I am considering the method is incorrect. Any hints will be appreciated.
Device info
Printer: Manufacturer Model XVI
python-escpos version: 0.0.0 2.2.1
python version: 0.0 2.7
operating system: Ubuntu
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Code page 936 (Microsoft Windows) - Wikipedia
Windows Code page 936 is Microsoft's character encoding for simplified Chinese, one of the four DBCSs for East Asian languages. Originally, Windows-936 ...
Read more >Adding Code page 936 for proper display of Chinese characters
The most common is the Microsoft CP936. This corresponds to the IANA “GBK” font. To properly display simplified Chinese characters in eFORMz ...
Read more >MIME MESSAGES WITH CHARACTER ENCODING CP936 ...
Then the Chinese Characters in the mail body display well. Problem summary. LCU supports CP936, but the caller function does not use the...
Read more >What is the differnence between gbk and cp936 - Stack Overflow
My locale encoding is 'gbk' in other programming tools as I am a simplified Chinese user. But in Python ...
Read more >Retrieving multi-byte Chinese characters with ASE OLE DB ...
When using ASE OLE DB Provider with an ASE configured for charset cp936 (Chinese) the retrieval of chinese characters returns them in garbled...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@2q1w2007 只需要设置一下codepage就可以了。
win10 python2.7 epson TM-88IV
@NullYing Hi, thanks for the solution, it’s a stable solution. I’ve use it in my program.
I installed a new version of escpos today:
According to you try and some source code reading, I found I could print Chinese characters correctly by just this line:
Even don’t need to set the codepage.