Rather than transposing n + 1 bytes, including 1 it was not passed, before
calling utf16_to_utf8() and having that croak.
e 69422~
"Malformed surrogate $name croaks for utf16_to_utf8_reversed");
is($got, undef, 'hence eval returns undef');
}
+
+my $in = "NA";
+$got = eval {utf16_to_utf8_reversed($in, 1)};
+like($@, qr/^panic: utf16_to_utf8_reversed: odd bytelen 1 at/,
+ 'Odd byte length panics');
+is($got, undef, 'hence eval returns undef');
+is($in, "NA", 'and input unchanged');
(P) Something tried to call utf16_to_utf8 with an odd (as opposed
to even) byte length.
+=item panic: utf16_to_utf8_reversed: odd bytelen
+
+(P) Something tried to call utf16_to_utf8_reversed with an odd (as opposed
+to even) byte length.
+
=item panic: yylex
(P) The lexer got into a bad state while processing a case modifier.
PERL_ARGS_ASSERT_UTF16_TO_UTF8_REVERSED;
+ if (bytelen & 1)
+ Perl_croak(aTHX_ "panic: utf16_to_utf8_reversed: odd bytelen %"UVuf,
+ (UV)bytelen);
+
while (s < send) {
const U8 tmp = s[0];
s[0] = s[1];