mirror of
				https://github.com/python-escpos/python-escpos
				synced 2025-10-23 09:30:00 +00:00 
			
		
		
		
	adjust order in _encode_char to prioritise ASCII; ' ' is used in the character list to flag characters with no known UTF-8 code, better not encode as these
This commit is contained in:
		| @@ -132,10 +132,10 @@ class Encoder(object): | ||||
|         :param char: char to encode | ||||
|         :param charmap: dictionary for mapping characters in this code page | ||||
|         """ | ||||
|         if char in charmap: | ||||
|             return charmap[char] | ||||
|         if ord(char) < 128: | ||||
|             return ord(char) | ||||
|         if char in charmap: | ||||
|             return charmap[char] | ||||
|         return ord('?') | ||||
|  | ||||
|     def encode(self, text, encoding, defaultchar='?'): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Billington
					Michael Billington