1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-09-13 09:09:58 +00:00

update encoding issue in QR code method, add ported test cases

This commit is contained in:
Michael Billington
2016-03-20 19:30:00 +11:00
parent 0c1e9fc34b
commit 46b254bc0a
2 changed files with 83 additions and 2 deletions

View File

@@ -299,10 +299,10 @@ class Escpos(object):
# Set error correction level: L, M, Q, or H
self._send_2d_code_data(six.int2byte(69), cn, six.int2byte(48 + ec));
# Send content & print
self._send_2d_code_data(six.int2byte(80), cn, content, b'0');
self._send_2d_code_data(six.int2byte(80), cn, content.encode('utf-8'), b'0');
self._send_2d_code_data(six.int2byte(81), cn, b'', b'0');
def _send_2d_code_data(self, fn, cn, data, m=''):
def _send_2d_code_data(self, fn, cn, data, m=b''):
""" Wrapper for GS ( k, to calculate and send correct data length.
:param fn: Function to use.