const U8* x = s;
const U8* send;
STRLEN c;
+ STRLEN outlen = 0;
PERL_UNUSED_CONTEXT;
if (!len)
len = strlen((const char *)s);
send = s + len;
- if (el)
- *el = 0;
while (x < send) {
/* Inline the easy bits of is_utf8_char() here for speed... */
goto out;
}
x += c;
- if (el)
- (*el)++;
+ outlen++;
}
out:
+ if (el)
+ *el = outlen;
+
if (ep)
*ep = x;
- if (x != send)
- return FALSE;
-
- return TRUE;
+ return (x == send);
}
/*
updates len to contain the new length.
Returns zero on failure, setting C<len> to -1.
+If you need a copy of the string, see C<bytes_from_utf8>.
+
=cut
*/
if (!SvROK(retval) || SvTYPE(SvRV(retval)) != SVt_PVHV) {
if (SvPOK(retval))
Perl_croak(aTHX_ "Can't find Unicode property definition \"%"SVf"\"",
- retval);
+ (void*)retval);
Perl_croak(aTHX_ "SWASHNEW didn't return an HV ref");
}
return retval;