mirror of
https://github.com/python-escpos/python-escpos
synced 2025-08-24 09:03:34 +00:00
fixes to arguments for _encode_char
This commit is contained in:
@@ -126,7 +126,7 @@ class Encoder(object):
|
|||||||
is_encodable = char in available_map
|
is_encodable = char in available_map
|
||||||
return is_ascii or is_encodable
|
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
|
""" Encode a single character with the given encoding map
|
||||||
|
|
||||||
:param char: char to encode
|
:param char: char to encode
|
||||||
@@ -136,7 +136,7 @@ class Encoder(object):
|
|||||||
return ord(char)
|
return ord(char)
|
||||||
if char in charmap:
|
if char in charmap:
|
||||||
return charmap[char]
|
return charmap[char]
|
||||||
return ord('?')
|
return ord(defaultchar)
|
||||||
|
|
||||||
def encode(self, text, encoding, defaultchar='?'):
|
def encode(self, text, encoding, defaultchar='?'):
|
||||||
""" Encode text under the given encoding
|
""" Encode text under the given encoding
|
||||||
|
Reference in New Issue
Block a user