From: Abigail Date: Sat, 14 Jan 2017 03:01:39 +0000 (+0100) Subject: Make it fatal to pass malformed UTF-8. X-Git-Tag: v5.25.9~52 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/24ca458667a908883f2aad18ea28ad1a5637534e Make it fatal to pass malformed UTF-8. 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. --- diff --git a/pod/perldeprecation.pod b/pod/perldeprecation.pod index 6a827fb..3cbeffc 100644 --- a/pod/perldeprecation.pod +++ b/pod/perldeprecation.pod @@ -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} >> diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 9aab53a..69812b2 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -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