Force text to be compatible with CP437
All checks were successful
docker-image / docker (push) Successful in 9m55s
All checks were successful
docker-image / docker (push) Successful in 9m55s
This avoids a conversion error in PyFIS.
This commit is contained in:
parent
08b4842a1b
commit
539a1c8b84
1 changed files with 2 additions and 0 deletions
|
@ -33,6 +33,7 @@ class BubaCmd:
|
||||||
:param align: alignment options, see MIS1TextDisplay.ALIGN_*
|
:param align: alignment options, see MIS1TextDisplay.ALIGN_*
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
text = text.encode("CP437", "replace").decode("CP437") # force text to be CP437 compliant
|
||||||
if self.display is not None:
|
if self.display is not None:
|
||||||
self.display.simple_text(page, row, col, text, align)
|
self.display.simple_text(page, row, col, text, align)
|
||||||
self.send({
|
self.send({
|
||||||
|
@ -59,6 +60,7 @@ class BubaCmd:
|
||||||
:param align: alignment options, see MIS1TextDisplay.ALIGN_*
|
:param align: alignment options, see MIS1TextDisplay.ALIGN_*
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
text = text.encode("CP437", "replace").decode("CP437") # force text to be CP437 compliant
|
||||||
if self.display is not None:
|
if self.display is not None:
|
||||||
self.display.text(page, row, col_start, col_end, text, align)
|
self.display.text(page, row, col_start, col_end, text, align)
|
||||||
self.send({
|
self.send({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue