3 Replies Latest reply on Apr 24, 2018 6:42 AM by Unifaun Config

    Printing Chinese via ZPL code without using font

    Kira Raki

      Hello everyone,


      Could you please take a look on my problem?


      I am trying to printing Unicode characters via ZPL code without using font.

      I was successful with some Unicode language by using hex in ZPL code.

      For example:





      Result: Flügel


      However, when I try to print Chinese with the same way, nothing is printed to the printer.

      This is my python code for printing:


      #!/usr/bin/env python

      # -*- coding: utf-8 -*-

      #ZPL docs can be found at https://support.zebra.com/cpws/docs/zpl/zpl_manual.pdf

      #This works with Python 2, change the str to bytes if you are using Python 3

      import sys

      import socket

      import csv

      import os

      import pdb

      import sys

      import binascii



      TCP_IP = ''

      TCP_PORT = 9100

      BUFFER_SIZE = 4096



      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

      print s

      s.connect((TCP_IP, TCP_PORT))



      zpl = """^XA






      zpl = zpl + "_" + "_".join("{:02x}".format(ord(c)) for c in "传傳")

          #zpl = zpl + "_e7_8e_ab"

      zpl = zpl + """^XZ"""

      print zpl






      Thanks in advance for any helps.