text-transform attribute should assume that the start and end XML element attributes are in UTF8 codepoints
Steps to reproduce
Please run the attached demo.
Current behavior
When we declare a GtkLabel like this in the UI file:
<child>
<object class="GtkLabel" id="label">
<property name="label">Сценарий shell</property>
<property name="ellipsize">end</property>
<property name="max-width-chars">24</property>
<property name="selectable">True</property>
<property name="visible">True</property>
<attributes>
<attribute name="text-transform"
value="PANGO_TEXT_TRANSFORM_UPPERCASE"
start="0" end="1"/>
</attributes>
</object>
</child>
The start and end attributes of the text-transform attribute element are specified in indexes of bytes in the label string, and not in the indexes of UTF8 codepoints, so it is very hard to use text-transform attributes for non-ASCII strings.
Expected outcome
The start and end should specify the UTF8 codepoint index instead of bytes in the label string.
Version information
- GTK version is 4.8.1-1.1 (issue is also reproducible with the latest version from master branch)
- OpenSUSE Tumbleweed with latest updates
Additional information
This is the screenshot of the demo application which is attached to the ticket:
It can be seen that the label text is not "Сценарий shell" as it is specified in the UI file provided with the demo application.
DEMO application
Edited by Aleksandar Dezelin