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.
master
Benno Schulenberg 2021-03-24 16:56:14 +01:00
parent 74fcc3be79
commit de816840cb
1 changed files with 1 additions and 4 deletions

View File

@ -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