my @malformations = (
# ($testname, $bytes, $length, $allow_flags, $expected_error_flags,
# $allowed_uv, $expected_len, $needed_to_discern_len, $message )
- [ "zero length string malformation", "", 0,
- $UTF8_ALLOW_EMPTY, $UTF8_GOT_EMPTY, 0, 0, 0,
- qr/empty string/
- ],
+
+# Now considered a program bug, and asserted against
+ #[ "zero length string malformation", "", 0,
+ # $UTF8_ALLOW_EMPTY, $UTF8_GOT_EMPTY, 0, 0, 0,
+ # qr/empty string/
+ #],
[ "orphan continuation byte malformation", I8_to_native("${I8c}a"), 2,
$UTF8_ALLOW_CONTINUATION, $UTF8_GOT_CONTINUATION, $REPLACEMENT,
1, 1,
Calling macros like C<isALPHA_utf8> on malformed UTF-8 have issued a
deprecation warning since Perl v5.18. They now die.
+=item *
+
+Calling the functions C<utf8n_to_uvchr> and its derivatives, while
+passing a string length of 0, and specifying that this is allowed is now
+asserted against in DEBUGGING builds. If you have nothing to decode,
+you shouldn't call the decode function.
+
=back
=head1 Selected Bug Fixes
*errors |= UTF8_GOT_EMPTY;
if (! (flags & UTF8_ALLOW_EMPTY)) {
+
+ /* This so-called malformation is now treated as a bug in
+ * the caller. If you have nothing to decode, skip calling
+ * this function */
+ assert(0);
+
disallowed = TRUE;
if (ckWARN_d(WARN_UTF8) && ! (flags & UTF8_CHECK_ONLY)) {
pack_warn = packWARN(WARN_UTF8);