You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the good work! I'm currently using pylcddc in a project. However I find that I cannot send German characters like Ö, ö, Ü, ü, Ä, ä, and ß. Currently I use "unidecode()" as a workaround, which replace Ö with O, ö with o etc. I don't like it very much, as for example "G.F. Händel" becomes "G.F. Handel". (On Kodi/Libreelec I do get those characters on my display, so it must be possible somehow.)
Error msg:
pi@LCD-Raspberry:~ $ ./test-logging-test-rotating-spieldauer.py
Traceback (most recent call last):
File "/home/pi/./test-logging-test-rotating-spieldauer.py", line 161, in
main()
File "/home/pi/./test-logging-test-rotating-spieldauer.py", line 98, in main
LCD_UNTEN.text = werk
File "/home/pi/.local/lib/python3.9/site-packages/pylcddc/widgets.py", line 789, in text
self._validate_input(self.x, self.y, self.width, self.height,
File "/home/pi/.local/lib/python3.9/site-packages/pylcddc/widgets.py", line 674, in _validate_input
raise ValueError(f'invalid character in text: {ch!r}')
ValueError: invalid character in text: 'ü'
Could you please have a look?
Regards,
Hans
The text was updated successfully, but these errors were encountered:
This was added because some LCDs multiplex command and display data over the same channel - a user could inadvertently send command sequences and mutate the (non display) state of their LCD because most LCDd drivers pass data directly to the display.
The umlauts are likely rendered by Kodi sending them using the ISO/IEC 8859-1 character set. Unfortunately, pylcddc only accepts strings at the moment and does not allow changing character encodings (the default is UTF-8), so expanding ACCEPTABLE_CHARACTERS won't really fix the issue.
I'll likely make all the text regions accept both raw bytes and str instead of only str so that users can choose their encodings (if they want to display non ASCII characters).
Hallo Shenghao,
I was thinking of editing Line 36 in widgets.py, but I get your point, that will not fix the issue.
I hope you find the time to make it possible to send raw bytes. Thanks in advance!
Cheers,
Hans
Hallo Shenghao,
Thanks for the good work! I'm currently using pylcddc in a project. However I find that I cannot send German characters like Ö, ö, Ü, ü, Ä, ä, and ß. Currently I use "unidecode()" as a workaround, which replace Ö with O, ö with o etc. I don't like it very much, as for example "G.F. Händel" becomes "G.F. Handel". (On Kodi/Libreelec I do get those characters on my display, so it must be possible somehow.)
Error msg:
pi@LCD-Raspberry:~ $ ./test-logging-test-rotating-spieldauer.py
Traceback (most recent call last):
File "/home/pi/./test-logging-test-rotating-spieldauer.py", line 161, in
main()
File "/home/pi/./test-logging-test-rotating-spieldauer.py", line 98, in main
LCD_UNTEN.text = werk
File "/home/pi/.local/lib/python3.9/site-packages/pylcddc/widgets.py", line 789, in text
self._validate_input(self.x, self.y, self.width, self.height,
File "/home/pi/.local/lib/python3.9/site-packages/pylcddc/widgets.py", line 674, in _validate_input
raise ValueError(f'invalid character in text: {ch!r}')
ValueError: invalid character in text: 'ü'
Could you please have a look?
Regards,
Hans
The text was updated successfully, but these errors were encountered: