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
parent
74fcc3be79
commit
de816840cb
|
@ -620,9 +620,6 @@ bool white_string(const char *string)
|
||||||
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
|
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
|
||||||
bool is_valid_unicode(wchar_t wc)
|
bool is_valid_unicode(wchar_t wc)
|
||||||
{
|
{
|
||||||
return ((0 <= wc && wc <= 0xD7FF) ||
|
return ((0 <= wc && wc <= 0xD7FF) || (0xE000 <= wc && wc <= 0x10FFFF));
|
||||||
(0xE000 <= wc && wc <= 0xFDCF) ||
|
|
||||||
(0xFDF0 <= wc && wc <= 0xFFFD) ||
|
|
||||||
(0xFFFF < wc && wc <= 0x10FFFF && (wc & 0xFFFF) <= 0xFFFD));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue