This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add is_utf8_non_invariant_string()
authorKarl Williamson <khw@cpan.org>
Sat, 18 Nov 2017 21:05:07 +0000 (14:05 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 26 Nov 2017 17:19:46 +0000 (10:19 -0700)
commitc9cd936b8f828f1c71873b459ceaec2300fec6c7
treebb2864c47121b20cf204b5cae5cd580f78e75169
parentdd237e826e98a1f24e4b18cc6176152da1f1fd58
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.
embed.fnc
embed.h
inline.h
proto.h