utf8.c
/*
=for apidoc is_utf8_char_buf

Returns the number of bytes that comprise the first UTF-8 encoded character in
buffer C<buf>.  C<buf_end> should point to one position beyond the end of the
buffer.  0 is returned if C<buf> does not point to a complete, valid UTF-8
encoded character.

Note that an INVARIANT character (i.e. ASCII on non-EBCDIC
machines) is a valid UTF-8 character.

=cut */
for apidoc is_utf8_char_buf
Returns the number of bytes that comprise the first UTF-8 encoded character in
buffer C.  C should point to one position beyond the end of the
buffer.  0 is returned if C does not point to a complete, valid UTF-8
encoded character.

Note that an INVARIANT character  is a valid UTF-8 character.

cut
for apidoc is_utf8_char_buf Returns the number of bytes that comprise the first UTF - 8 encoded character in buffer C . C should point to one position beyond the end of the buffer . 0 is returned if C does not point to a complete valid UTF - 8 encoded character . Note that an INVARIANT character is a valid UTF - 8 character . cut
STRLEN
Perl_is_utf8_char_buf(const U8 *buf, const U8* buf_end)
{
    STRLEN len;
    PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF;
    if (buf_end <= buf) {
	return 0;
    }
    len = buf_end - buf;
    if (len > UTF8SKIP(buf)) {
	len = UTF8SKIP(buf);
    }
#ifdef IS_UTF8_CHAR
    if (IS_UTF8_CHAR_FAST(len))
        return IS_UTF8_CHAR(buf, len) ? len : 0;
#endif 
    return is_utf8_char_slow(buf, len);
}
STRLEN Perl_is_utf8_char_buf ( const U8 * buf , const U8 * buf_end ) { STRLEN len ; PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF ; if ( buf_end <= buf ) { return 0 ; } len = buf_end - buf ; if ( len > UTF8SKIP ( buf ) ) { len = UTF8SKIP ( buf ) ; } #ifdef IS_UTF8_CHAR if ( IS_UTF8_CHAR_FAST ( len ) ) return IS_UTF8_CHAR ( buf , len ) ? len : 0 ; #endif return is_utf8_char_slow ( buf , len ) ; }
for apidoc is_utf8_char_buf
Returns the number of bytes that comprise the first UTF-8 encoded character in
buffer C<buf>.
for apidoc is_utf8_char_buf Returns the number of bytes that comprise the first UTF - 8 encoded character in buffer C<buf > .
/* #ifdef IS_UTF8_CHAR */