mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-09-29 17:50:08 +02:00
write_escaped_ch compares the decoded rune against utf8.RuneError to detect invalid UTF-8, but a literal U+FFFD decodes to that same rune, so an escaped replacement character was silently deleted. The size returned by DecodeRuneInString already tells the two apart: invalid bytes decode with a size of one, a real U+FFFD with a size of three. Keep the rune when the size is greater than one.