diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-03-18 13:37:28 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-03-18 13:37:28 +0000 |
| commit | 878e07da59855d62e89eba5f5f479a5ee598998e (patch) | |
| tree | 0ac7dd5f06c9fb9e6a7b6665d2ec38253b24bf97 /render.c | |
| parent | changelog: add new 'unreleased' section (diff) | |
vt: utf8: don't discard current byte when an invalid UTF-8 sequence is detected
Example:
printf "pok\xe9mon\n"
would result in 'pokon' - the 'm' has been discarded along with E9.
While correct, in some sense, it's perhaps not intuitive.
This patch changes the VT parser to instead discard everything up to
the invalid byte, but then try the invalid byte from the ground
state. This way, invalid UTF-8 sequences followed by both plain ASCII,
or longer (and valid) UTF-8 sequences are printed as expected instead
of being discarded.
Diffstat (limited to 'render.c')
0 files changed, 0 insertions, 0 deletions
