Bug 488100 - U+FFFD Replacement character width mismatch
Summary: U+FFFD Replacement character width mismatch
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 24.02.2
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-06 09:42 UTC by VP
Modified: 2024-06-06 09:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description VP 2024-06-06 09:42:48 UTC
SUMMARY
The U+FFFD character has width 1, but the glyph takes 2 columns on the screen.

STEPS TO REPRODUCE
1. in konsole+shell:  `echo '-_-_-' ; echo -e "-_\uFFFD_-"`

OBSERVED RESULT

The first line just prints an auxiliary pattern of 5 plain chars. Its total width is 5 cells.

The second line prints the same pattern with the middle character replaced by the replacement mark: � (a questionmark on a diamond-shaped background).

The second line has also the total width 5, the pattern matches column by column, but the � character occupies two cells and partially overwrites the next character.

EXPECTED RESULT

Either the U+FFFD character is double-width and takes 2 cells making the total length equal to 6 (instead of 5) or its a regular witdth character and takes just 1 screen cell without any overlap.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.05
Qt Version: 6.7.1

ADDITIONAL INFORMATION

This  C program prints that the width of the Unicode character in question is 1.

```
#define _XOPEN_SOURCE
#include <locale.h>
#include <stdio.h>
#include <wchar.h>

int main() {
    setlocale(LC_ALL, "en_US.UTF-8");
    printf("width %d\n", wcwidth((wchar_t)0xFFFD));
}
```