Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Chinese cp936 support  #190

@wweiradio

Description

@wweiradio

Bug 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions