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
I encountered this problem, while trying to print a gcode file whose name included this non-ascii character: æ.
The attached snippet from Klipper.log shows what Klipper was able to report.
To troubleshoot this issue, I looked-up the ascii character xe6 that it was complaining about, and recognized the æ character in the filename. Sure enough, delete that character from the filename and t5uid1 is very happy to go ahead and print it.
I expect that the problem is incurred when the code that displays the current filename at the top of the Print Status screen tries to encode the message to the display.
It would probably be helpful if there is some way to substitute '_' for all non-ascii (128) characters in such strings, before they reach that routine.
Can someone in the Community please suggest how I might go about adding that?
Coders familiar with encoding and decoding unicode strings in python may recognize the root of my troubles being that t5uid1.py is assuming all strings to be composed of some combination of the 128 ascii characters, while python3 works in unicode or utf-8.
The æ character is of course not within that set of ascii characters. This article offers some ideas, but I would rather not ignore the æ, or replace æ with a "?".
xmlcharrefreplace inserted \x.. character pointers, on the display. Party of my problem may lie in the DWIN_SET definition of this particular field...
I can use errors="ignore" for now, but looking for a better option...
Since the current app seems to be having trouble executing vars_out.filename, I have implemented a local solution, with this mod to the filename string encoding instructions:
[t5uid1_var file_name]
type: output
address: 0x31c1
data_type: str
data_len: 32
script:
{% if printer.print_stats.filename %}
{"{:>32s}".format((printer.print_stats.filename.encode(encoding="ascii",errors="ignore").decode())|trim)}
{% else %}
{"No name passed by slicer"}
{% endif %}
Now any non-ascii character(s) in the filename are simply left out of the filename.
I encountered this problem, while trying to print a gcode file whose name included this non-ascii character: æ.
The attached snippet from Klipper.log shows what Klipper was able to report.
To troubleshoot this issue, I looked-up the ascii character xe6 that it was complaining about, and recognized the æ character in the filename. Sure enough, delete that character from the filename and t5uid1 is very happy to go ahead and print it.
I expect that the problem is incurred when the code that displays the current filename at the top of the Print Status screen tries to encode the message to the display.
It would probably be helpful if there is some way to substitute '_' for all non-ascii (128) characters in such strings, before they reach that routine.
Can someone in the Community please suggest how I might go about adding that?
KlippyLogExtract.txt
The text was updated successfully, but these errors were encountered: