Diffusion KWin 57440d1d6b49

Fix captions with non-BMP characters

Authored by cfeck on Apr 26 2019, 8:52 AM.

Description

Fix captions with non-BMP characters

KWin replaces any non-printable character with a space. This check does not
handle surrogate pairs correctly. Additionally, translators sometimes insert
non-printable soft-hyphens into titles, which also cause KWin to display a
space instead.

This code adds the missing surrogate handling, and (to fix both issues), also
removes non-printable characters instead of replacing them with a space.

Also moved the changed test after these changes, so that changes in non-
printable characters do not cause unneeded redraws.

Unit tests adapted by Vlad Zagorodniy.

Test Plan:

kwrite /tmp/Test😣.txt shows correct title. I also tested actual non-printable
characters, such as 0x1A, and these are correctly omitted.

BUG: 376813
FIXED-IN: 5.15.5

Reviewers: KWin, zzag

Reviewed By: KWin, zzag

Subscribers: zzag, grasslin, kwin

Tags: KWin

Differential Revision: https://phabricator.kde.org/D19052

Details

Committed
cfeckApr 26 2019, 8:52 AM
Reviewer
KWin
Differential Revision
D19052: Fix captions with non-BMP characters
Parents
R108:97c3cb73ffdc: [libkwineffects] Use fully qualified type name for signal
Branches
Unknown
Tags
Unknown