Determines the number of bytes comprising a multibyte character. Format #include <stdlib.h> int mblen (const char *s, size_t n);
1 – Arguments
s A pointer to the multibyte character. n The maximum number of bytes that comprise the multibyte character.
2 – Description
If the character is n bytes or less, the mblen function returns the number of bytes comprising the multibyte character pointed to by s. If the character is greater than n bytes, the function returns -1 to indicate an error. This function is affected by the LC_CTYPE category of the program's current locale.
3 – Return Values
x The number of bytes that comprise the multibyte character, if the next n or fewer bytes form a valid character. 0 If s is NULL or a pointer to the NULL character. -1 Indicates an error. The function sets errno to EILSEQ - Invalid character detected.