This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add is_utf8_non_invariant_string()
This function tells whether or not its argument is a sequence of bytes
that is legal Perl-extended-UTF-8, and which either requires UTF-8
(because it contains wide characters) or would have a different
representation when not under UTF-8.
This paradigm is used in several places in the perl core to decide
whether to turn on an SV's utf8 flag. None of those places realized
that there was a simple way to avoid rescanning the string (though
perhaps a good C optimizer would). This commit creates a funtion that
does this task without the rescan; the next commits will convert to use
this function.