This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Change UTF8 to UVCHR
authorKarl Williamson <khw@cpan.org>
Tue, 6 Jun 2017 08:01:10 +0000 (02:01 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 8 Jun 2017 17:04:43 +0000 (11:04 -0600)
There is no practical difference between UTF8_IS_INVARIANT and
UVCHR_IS_INVARIANT, except that the latter is supposed to be used on
characters.  Fix to conform.

utf8.c

diff --git a/utf8.c b/utf8.c
index 6c73921..e13d5e9 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1942,7 +1942,7 @@ Perl_utf8_to_bytes(pTHX_ U8 *s, STRLEN *len)
     d = s = save;
     while (s < send) {
        U8 c = *s++;
-       if (! UTF8_IS_INVARIANT(c)) {
+       if (! UVCHR_IS_INVARIANT(c)) {
            /* Then it is two-byte encoded */
            c = EIGHT_BIT_UTF8_TO_NATIVE(c, *s);
             s++;