This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make it fatal to pass malformed UTF-8.
authorAbigail <abigail@abigail.be>
Sat, 14 Jan 2017 03:01:39 +0000 (04:01 +0100)
committerAbigail <abigail@abigail.be>
Mon, 16 Jan 2017 18:18:15 +0000 (19:18 +0100)
Due to a bug in either Perl, or in some XS-code, it's possible
for a string which is supposed to be in UTF-8 format to not be
properly encoded. If you try to find out its type (digit,
punctuation) perl will now croak.

This behaviour was deprecated in Perl 5.18.

pod/perldeprecation.pod
pod/perldiag.pod

index 6a827fb..3cbeffc 100644 (file)
@@ -305,6 +305,20 @@ was by documentation policy only. But this deprecation has been
 lifted in Perl 5.26.
 
 
+=head3 Malformed UTF-8 string in "%s"
+
+This message indicates a bug either in the Perl core or in XS
+code. Such code was trying to find out if a character, allegedly
+stored internally encoded as UTF-8, was of a given type, such as
+being punctuation or a digit.  But the character was not encoded
+in legal UTF-8.  The C<%s> is replaced by a string that can be used
+by knowledgeable people to determine what the type being checked
+against was.
+
+Passing malformed strings was deprecated in Perl 5.18, and
+became fatal in Perl 5.26.
+
+
 =head2 Perl 5.24
 
 =head3 Use of C<< *glob{FILEHANDLE} >>
index 9aab53a..69812b2 100644 (file)
@@ -3413,6 +3413,19 @@ rules and perl was unable to guess how to make more progress.
 (F) You tried to unpack something that didn't comply with UTF-8 encoding
 rules and perl was unable to guess how to make more progress.
 
+=item Malformed UTF-8 string in "%s"
+
+(F) This message indicates a bug either in the Perl core or in XS
+code. Such code was trying to find out if a character, allegedly
+stored internally encoded as UTF-8, was of a given type, such as
+being punctuation or a digit.  But the character was not encoded
+in legal UTF-8.  The C<%s> is replaced by a string that can be used
+by knowledgeable people to determine what the type being checked
+against was.
+
+Passing malformed strings was deprecated in Perl 5.18, and
+became fatal in Perl 5.26.
+
 =item Malformed UTF-16 surrogate
 
 (F) Perl thought it was reading UTF-16 encoded character data but while