From 7a7ea23628c99790ba73c223906e49f0c2f42cc1 Mon Sep 17 00:00:00 2001 From: Michael Billington Date: Sun, 11 Sep 2016 21:08:04 +1000 Subject: [PATCH] fixes to arguments for _encode_char --- src/escpos/magicencode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/escpos/magicencode.py b/src/escpos/magicencode.py index d48d59d..ded60b8 100644 --- a/src/escpos/magicencode.py +++ b/src/escpos/magicencode.py @@ -126,7 +126,7 @@ class Encoder(object): is_encodable = char in available_map return is_ascii or is_encodable - def _encode_char(self, char, charmap): + def _encode_char(self, char, charmap, defaultchar): """ Encode a single character with the given encoding map :param char: char to encode @@ -136,7 +136,7 @@ class Encoder(object): return ord(char) if char in charmap: return charmap[char] - return ord('?') + return ord(defaultchar) def encode(self, text, encoding, defaultchar='?'): """ Encode text under the given encoding