nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit de816840cb39c915b20ecf5225acded37f95ba9d
parent 74fcc3be791db11c9a7248e5c4082d7df4fd56dc
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 24 Mar 2021 16:56:14 +0100

input: accept Unicode codes for non-characters as valid, since they are

That is, accept U+FDD0 to U+FDEF, and accept U+xxFFFE and U+xxFFFF
for xx from 00 to 10 hex, being the 66 reserved "non-characters".

It may not be wise of the user to input these "things" (by typing
their code after M-V), but the codes are valid Unicode code points
and should not be rejected.

See https://www.unicode.org/faq/private_use.html#nonchar8 et al.

This fixes https://savannah.gnu.org/bugs/?60263.

Bug existed since before version 2.0.0.

Diffstat:
Msrc/chars.c | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/chars.c b/src/chars.c @@ -620,9 +620,6 @@ bool white_string(const char *string) /* Return TRUE if wc is valid Unicode, and FALSE otherwise. */ bool is_valid_unicode(wchar_t wc) { - return ((0 <= wc && wc <= 0xD7FF) || - (0xE000 <= wc && wc <= 0xFDCF) || - (0xFDF0 <= wc && wc <= 0xFFFD) || - (0xFFFF < wc && wc <= 0x10FFFF && (wc & 0xFFFF) <= 0xFFFD)); + return ((0 <= wc && wc <= 0xD7FF) || (0xE000 <= wc && wc <= 0x10FFFF)); } #endif