Searched hist:"2 fed1c57" (Results 1 – 2 of 2) sorted by relevance
/freebsd/sys/teken/ |
H A D | teken_wcwidth.h | 2fed1c57 Fri Oct 13 05:14:36 GMT 2023 Bojan Novković <bojan.novkovic@fer.hr> tty/teken: fix UTF8 sequence validation logic
This patch fixes UTF-8 sequence validation logic in teken_utf8_bytes_to_codepoint() and fixes fallback behaviour in ttydisc_rubchar() when an invalid UTF8 sequence is encountered. The code previously used __bitcount() to extract sequence length information from the leading byte. However, this assumption breaks for certain code points that have additional bits set in the first half of the leading byte (e.g. Cyrillic characters). This lead to incorrect behaviour when deleting those characters using backspaces. The code now checks the number of consecutive set bits in the leading byte starting from the MSB, as per RFC 3629.
Reviewed by: christos MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42147 2fed1c57 Fri Oct 13 05:14:36 GMT 2023 Bojan Novković <bojan.novkovic@fer.hr> tty/teken: fix UTF8 sequence validation logic
This patch fixes UTF-8 sequence validation logic in teken_utf8_bytes_to_codepoint() and fixes fallback behaviour in ttydisc_rubchar() when an invalid UTF8 sequence is encountered. The code previously used __bitcount() to extract sequence length information from the leading byte. However, this assumption breaks for certain code points that have additional bits set in the first half of the leading byte (e.g. Cyrillic characters). This lead to incorrect behaviour when deleting those characters using backspaces. The code now checks the number of consecutive set bits in the leading byte starting from the MSB, as per RFC 3629.
Reviewed by: christos MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42147
|
/freebsd/sys/kern/ |
H A D | tty_ttydisc.c | 2fed1c57 Fri Oct 13 05:14:36 GMT 2023 Bojan Novković <bojan.novkovic@fer.hr> tty/teken: fix UTF8 sequence validation logic
This patch fixes UTF-8 sequence validation logic in teken_utf8_bytes_to_codepoint() and fixes fallback behaviour in ttydisc_rubchar() when an invalid UTF8 sequence is encountered. The code previously used __bitcount() to extract sequence length information from the leading byte. However, this assumption breaks for certain code points that have additional bits set in the first half of the leading byte (e.g. Cyrillic characters). This lead to incorrect behaviour when deleting those characters using backspaces. The code now checks the number of consecutive set bits in the leading byte starting from the MSB, as per RFC 3629.
Reviewed by: christos MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42147 2fed1c57 Fri Oct 13 05:14:36 GMT 2023 Bojan Novković <bojan.novkovic@fer.hr> tty/teken: fix UTF8 sequence validation logic
This patch fixes UTF-8 sequence validation logic in teken_utf8_bytes_to_codepoint() and fixes fallback behaviour in ttydisc_rubchar() when an invalid UTF8 sequence is encountered. The code previously used __bitcount() to extract sequence length information from the leading byte. However, this assumption breaks for certain code points that have additional bits set in the first half of the leading byte (e.g. Cyrillic characters). This lead to incorrect behaviour when deleting those characters using backspaces. The code now checks the number of consecutive set bits in the leading byte starting from the MSB, as per RFC 3629.
Reviewed by: christos MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42147
|