UTF8LEN() and UTF8SKIP().
p4raw-id: //depot/perl@7437
while (tmps < send) {
UV c = utf8_to_uv(tmps, &l);
tmps += UTF8SKIP(tmps);
- targlen += UTF8LEN(~c);
+ targlen += UNISKIP(~c);
}
/* Now rewind strings and write them. */
s++;
}
- if (UTF8LEN(uv) < len)
+ if (UNISKIP(uv) < len)
return 0;
return len;
"Malformed UTF-8 character (impossible character 0x%04"UVxf")",
uv);
goto malformed;
- } else if (expectlen > UTF8LEN(uv)) {
+ } else if (expectlen > UNISKIP(uv)) {
if (dowarn)
Perl_warner(aTHX_ WARN_UTF8,
"Malformed UTF-8 character (%d byte%s, need %d)",
- expectlen, expectlen > 1 ? "s": "", UTF8LEN(uv));
+ expectlen, expectlen > 1 ? "s": "", UNISKIP(uv));
goto malformed;
}
#define UTF8SKIP(s) PL_utf8skip[*(U8*)s]
#ifdef HAS_QUAD
-#define UTF8LEN(uv) ( (uv) < 0x80 ? 1 : \
+#define UNISKIP(uv) ( (uv) < 0x80 ? 1 : \
(uv) < 0x800 ? 2 : \
(uv) < 0x10000 ? 3 : \
(uv) < 0x200000 ? 4 : \
(uv) < 0x1000000000LL ? 7 : 13 )
#else
/* No, I'm not even going to *TRY* putting #ifdef inside a #define */
-#define UTF8LEN(uv) ( (uv) < 0x80 ? 1 : \
+#define UNISKIP(uv) ( (uv) < 0x80 ? 1 : \
(uv) < 0x800 ? 2 : \
(uv) < 0x10000 ? 3 : \
(uv) < 0x200000 ? 4 : \