for (["\xD8\0\0\0", 'NULs'],
["\xD8\0\xD8\0", '2 Lows'],
+ ["\xDC\0\0\0", 'High NUL'],
+ ["\xDC\0\xD8\0", 'High Low'],
+ ["\xDC\0\xDC\0", 'High High'],
) {
my ($malformed, $name) = @$_;
$got = eval {utf16_to_utf8($malformed)};
Perl_croak(aTHX_ "Malformed UTF-16 surrogate");
uv = ((uv - 0xd800) << 10) + (low - 0xdc00) + 0x10000;
}
+ } else if (uv >= 0xdc00 && uv <= 0xdfff) {
+ Perl_croak(aTHX_ "Malformed UTF-16 surrogate");
}
if (uv < 0x10000) {
*d++ = (U8)(( uv >> 12) | 0xe0);