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
{{ message }}
Repository navigation
"Display Info on LCD" outputs ISO-8859-1, "Klipper preprocessor" cannot handle ISO-8859-1 #21624
Status: Under InvestigationThe issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion.Type: BugThe code does not produce the intended behavior.
Note the degree sign °, outputting a literal 0xb0. If you have “Klipper Preprocessor v1.4.1” later in the chain, it will get skipped because:
Unhandled exception:
'ascii' codec can't encode character '\xb0' in position 21: ordinal not in range(128)
You could argue that this is a bug of klipper-preprocessor, but G-Code in general is ASCII (and at the very least, this should be UTF-8, not ISO-8859-1).
Actual results
Unhandled exception:
'ascii' codec can't encode character '\xb0' in position 21: ordinal not in range(128)
Expected results
The simple fix would presumably be to just remove the degree symbol and replace it with “C” or similar.
Thanks for the report.
It seems that substituting "\u00b0" for "°" should work.
There are other post processors (mostly mine) that have "degree symbols" called out in them. I'll make those changes and submit them.
I am honestly unsure; it could very well be that using UTF-8 instead of ISO-8859-1 would make the downstream scripts happier, but it might also depend on the environment variable PYTHONIOENCODING (I'm honestly not sure). Given that the error message talks about the “ascii” codec and not “utf-8”, I suspect using UTF-8 isn't entirely safe, but I wouldn't know for sure without actually building Cura from source again (which takes quite a bit of time on my laptop).
It was 4 years ago when I made the original set of changes to "Display Info on LCD" and this is the first that this problem has been mentioned. When the next version of Cura is released, this change should be in it.
Status: Under InvestigationThe issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion.Type: BugThe code does not produce the intended behavior.
Activity
GregValiant commentedon May 24, 2026
Thanks for the report.
It seems that substituting "\u00b0" for "°" should work.
There are other post processors (mostly mine) that have "degree symbols" called out in them. I'll make those changes and submit them.
sesse commentedon May 24, 2026
I am honestly unsure; it could very well be that using UTF-8 instead of ISO-8859-1 would make the downstream scripts happier, but it might also depend on the environment variable PYTHONIOENCODING (I'm honestly not sure). Given that the error message talks about the “ascii” codec and not “utf-8”, I suspect using UTF-8 isn't entirely safe, but I wouldn't know for sure without actually building Cura from source again (which takes quite a bit of time on my laptop).
Thanks for looking into this!
GregValiant commentedon May 25, 2026
It was 4 years ago when I made the original set of changes to "Display Info on LCD" and this is the first that this problem has been mentioned. When the next version of Cura is released, this change should be in it.