Commit e18669d645 for perl
commit e18669d6452019103e25cb7e057d5525061acd81
Author: Tony Cook <tony@develop-help.com>
Date: Thu Oct 8 10:03:02 2026 +1100
unpack: test for unpack utf-8 warning message handling
diff --git a/t/lib/warnings/pp_pack b/t/lib/warnings/pp_pack
index 29ab0ac991..a26ad3ad64 100644
--- a/t/lib/warnings/pp_pack
+++ b/t/lib/warnings/pp_pack
@@ -73,3 +73,13 @@ Character in 'c' format wrapped in pack at - line 3.
-128
127
-128
+########
+# NAME utf8 decoding warning collection GH24913
+use Encode qw(_utf8_on);
+my $y = "\xC0xxx";
+_utf8_on($y);
+use warnings "utf8";
+my ($z) = unpack("N", $y);
+EXPECT
+Malformed UTF-8 character: \xc0\x78 (unexpected non-continuation byte 0x78, immediately after start byte 0xc0; need 2 bytes, got 1) at - line 5.
+Malformed UTF-8 character: \xc0 (any UTF-8 sequence that starts with "\xc0" is overlong which can and should be represented with a different, shorter sequence) at - line 5.