maxon::String Fails to Display "º" in Control Name
-
Hi guys,
I'm having an issue creating attribute panel control names that include the degree symbol "º".
For example, when creating a button control with the following Maxon string:
Example A (works):
const char* name_char = "Slope 90";
maxon::String name_maxon(name_char);
Example B (fails – button name is blank):
const char* name_char = "Slope 90º";
maxon::String name_maxon(name_char);
The name_char variable is just for testing purposes. In the actual application, the string is read from the file system.
The name_maxon string is then used to set the control name in the attribute panel.Any ideas why the degree symbol causes the control name to appear blank?
Thanks!
-
Hey @Viktor-Velicko,
Thank you for reaching out to us. Generally, our codebase supports Unicode, but in C++ source code and in
*.str
resource files, we only support Unicode escape sequences, not Unicode symbols directly. In Python, we do support Unicode symbols directly. In the 2025.3 SDK, I just added a code example for how to use Python to create a Unicode escaping pipeline around*.str
files.So, the Unicode string
const String slopeLabel = "Slope 90º"_s;
would be written asconst String slopeLabel = "Slope 90\\u00b0"_s;
in C++. A bit more verbose variant would beconst String slopeLabel ="Slope 90"_s + String("\\u00b0", STRINGENCODING::BIT7HEX));
. In Python, you can use the string directly asslopeLabel: str = "Slope 90°"
.Cheers,
Ferdinand