Force text to be compatible with CP437
All checks were successful
docker-image / docker (push) Successful in 9m55s

This avoids a conversion error in PyFIS.
This commit is contained in:
Stefan Bethke 2025-06-01 20:43:52 +02:00
commit 539a1c8b84

View file

@ -33,6 +33,7 @@ class BubaCmd:
:param align: alignment options, see MIS1TextDisplay.ALIGN_*
:return:
"""
text = text.encode("CP437", "replace").decode("CP437") # force text to be CP437 compliant
if self.display is not None:
self.display.simple_text(page, row, col, text, align)
self.send({
@ -59,6 +60,7 @@ class BubaCmd:
:param align: alignment options, see MIS1TextDisplay.ALIGN_*
:return:
"""
text = text.encode("CP437", "replace").decode("CP437") # force text to be CP437 compliant
if self.display is not None:
self.display.text(page, row, col_start, col_end, text, align)
self.send({