0xFFFE..0xFFFF. Ranges 0x...FFFE..0x...FFFF in general,
and characters beyond 0x10FFF should be disallowed, too,
but some tests would need changing, but more importantly some
APIs would need remodeling since one can easily generate such
characters either by bitwise complements, tr complements, or
v-strings.
p4raw-id: //depot/perl@13722
(F) The unexec() routine failed for some reason. See your local FSF
representative, who probably put it there in the first place.
+=item Unicode character %s is illegal
+
+Certain Unicode characters have been designated off-limits by the
+Unicode standard and should not be generated.
=item Unknown BYTEORDER
U8 *
Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv)
{
+ if (UNICODE_IS_SURROGATE(uv))
+ Perl_croak(aTHX_ "UTF-16 surrogate 0x%04"UVxf, uv);
+ else if ((uv >= 0xFDD0 && uv <= 0xFDEF) ||
+ (uv == 0xFFFE || uv == 0xFFFF))
+ Perl_croak(aTHX_ "Unicode character 0x%04"UVxf" is illegal", uv);
if (UNI_IS_INVARIANT(uv)) {
*d++ = UTF_TO_NATIVE(uv);
return d;
}
- if (UNICODE_IS_SURROGATE(uv))
- Perl_croak(aTHX_ "UTF-16 surrogate 0x%04"UVxf, uv);
#if defined(EBCDIC)
else {
STRLEN len = UNISKIP(uv);