Fix UTF-8 corruption in Custom G-code editor (°C and other Unicode characters) #1473

Closed
opened 2026-04-05 17:56:19 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @kisslorand on 11/29/2025

This PR fixes an issue where certain characters (for example the degree symbol ° used in °C) became corrupted after opening and saving the Custom G-code editor multiple times.

What was the problem?

When users added symbols like ° inside Start/End G-code, the editor would show them correctly the first time, but after reopening the dialog a few times the text would slowly change into strange characters.

How to reproduce

  • Open any Custom G-code field
  • Add a line containing °C
  • Save the dialog
  • Reopen it several times
  • The text begins to change into unreadable characters

What this PR changes

The Custom G-code editor now properly loads and saves text that contains symbols such as °, so these characters stay exactly as the user typed them. This keeps Custom G-code stable across editing sessions and prevents slow corruption of Unicode characters.

Result

  • °C and similar symbols remain correct
  • No more “weird characters” appearing after multiple reopen/save cycles
  • Custom G-code is preserved accurately

Fixes #11502

*Originally created by @kisslorand on 11/29/2025* This PR fixes an issue where certain characters (for example the degree symbol ° used in °C) became corrupted after opening and saving the Custom G-code editor multiple times. #### What was the problem? When users added symbols like ° inside Start/End G-code, the editor would show them correctly the first time, but after reopening the dialog a few times the text would slowly change into strange characters. #### How to reproduce - Open any Custom G-code field - Add a line containing °C - Save the dialog - Reopen it several times - The text begins to change into unreadable characters #### What this PR changes The Custom G-code editor now properly loads and saves text that contains symbols such as °, so these characters stay exactly as the user typed them. This keeps Custom G-code stable across editing sessions and prevents slow corruption of Unicode characters. #### Result - °C and similar symbols remain correct - No more “weird characters” appearing after multiple reopen/save cycles - Custom G-code is preserved accurately Fixes #11502
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#1473