Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/utf8/utf8len.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/utf8/utf8len.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/utf8/utf8len.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/utf8/utf8len.html on line 8

utf8len()

Count the bytes in a UTF-8 character

Synopsis:

#include <utf8.h>

int utf8len( const char *s,
             size_t n );

Arguments:

s
A pointer to a UTF-8 character.
n
The maximum number of bytes to count.

Library:

ph

Description:

The utf8str() function counts the number of bytes in the UTF-8 character pointed to by s, to a maximum of n bytes, if n is nonzero.

This function is similar to mblen(), except that:

Returns:

0
s points to the null character.
> 0
The number of bytes that comprise the multibyte character (if the next n or fewer bytes form a valid multibyte character).
-1
The n-byte sequence that s points to isn't a valid (beginning of a) UTF-8-encoded character.
Other negative value
The n bytes pointed to by s could be the initial bytes of a valid UTF-8 sequence.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

utf8strblen(), utf8strlen(), utf8strnlen()

Unicode Multilingual Support in the Photon Programmer's Guide

mblen() in the QNX Neutrino Library Reference


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/utf8/utf8len.html on line 166

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/utf8/utf8len.html on line 166