https://bugs.kde.org/show_bug.cgi?id=435768

            Bug ID: 435768
           Summary: Difficulties creating titles with non-BMP characters
           Product: kdenlive
           Version: 20.12.3
          Platform: Ubuntu Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: User Interface
          Assignee: j...@kdenlive.org
          Reporter: k...@gravitystorm.co.uk
  Target Milestone: ---

SUMMARY

I've been having difficulties including some Unicode characters in Title and
Title Template clips. On detailed investigation, the affected characters were
beyond the Basic Multilingual Plane (BMP). I have a workaround that allows such
titles to be created and rendered, which shows that it mostly works, but other
actions like saving the project, or editing the title description, cause these
characters to be lost.

In Unicode, the Basic Multilingual Plane (BMP) covers characters from U+00001
to U+0FFFF, which covers most characters needed for day to day language. The
Supplemental Multilingual Plane (U+10000 to U+1FFFF) is increasingly useful,
since it contains many symbols and emoji.

In my testing, all BMP characters work fine, but no SMP characters work. In
UTF-16 encoding, BMP characters fit in two bytes, but SMP (and other)
characters need 4 bytes and use surrogate pairs. I suspect this is related,
since QString uses UTF-16 (with surrogate pairs) internally.

STEPS TO REPRODUCE
1. Start a new project, and select Add Title Clip.
2. Paste in the text "testɐᄃ𐀀🡡test" - this contains four unusual characters -
the first two from the BMP, the second two from the SMP.
3. Press Create Title.
3. Notice in the clip preview that the clip has "testɐᄃ test" i.e. the two SMP
characters have been lost.

OBSERVED RESULT

The title clip has "testɐᄃ test"

EXPECTED RESULT

The title clip should have "testɐᄃ𐀀🡡test"

ADDITIONAL INFORMATION

Elaborate workaround:

I have an elaborate workaround, which might help shed some light for
developers. It's actually what I was doing for my own project, without
realising there were going to be problems later on when I reloaded my project
the next day.

1. Create a new project
2. In the project bin, Create a Title Clip
3. Add "%s" as the text. Press the dropdown arrow beside Create Title and
instead press "Save and add to project"
4. Choose a name for your template and remember it for later
5. Next, in the project bin, add a Template Title Clip
6. From the Template dropdown, choose the template you have just created
7. In the text box, paste "testɐᄃ𐀀🡡test"
8. Press OK.
9. Notice that the clip description is correct, and in the clip preview, the
text is rendered correctly too. If you render the video, everything will work
too.
10. However, now edit the clip description by double clicking on it in the
project bin
11. Make a trivial change and press enter
12. Notice that the description has changed, and the SMP characters have been
lost.

Other ways to make the characters disappear including saving and reloading the
project. The SMP characters are not saved into the XML file. If you add them to
the XML by hand, they are not shown when the project loads.

It's also interesting to note that when you try changing the description in
step 11, you get a debug message on the console:

"// SETTING CLIP PROPERTIES:  QMap(("templatetext", "testɐᄃ𐀀🡡test"))"

This shows that the description is correct at that point, i.e. the GUI widget
can handle SMP characters, and they end up in the QString that's being
processed, but somewhere further on in the processing, the SMP characters are
lost.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to