This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.h: Add macro that handled malformed 2-byte UTF-8
The macro used traditionally to see if there is a two-byte UTF-8
sequence doesn't make sure that there actually is a second byte
available; it only checks if the first byte indicates that there is.
This adds a macro that is safe in the face of malformed UTF-8.
I inspected the existing calls in the core to the unsafe macro, and I
believe that none of them need to be converted to the safe version.