mblen()

determine length of multibyte character 

Function


SYNOPSIS

#include <stdlib.h>

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


DESCRIPTION

The mblen() function determines the length, in bytes, of the multibyte character pointed to by s.


PARAMETERS

s 

Pointer to multibyte character.

n 

Maximum number of bytes to examine for a multibyte character encoding. Regardless of the value of n, no more than MB_CUR_MAX bytes are scanned.


RETURN VALUES

The function mblen() returns the length, in bytes, of the multibyte character pointed to by s. If s is NULL or s points to multibyte null character, mblen() returns zero. If s points to an invalid multibyte character, mblen() returns -1.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe, with exceptions.

This function is MT-Safe as long as no thread calls setlocale() while this function is executing.


PORTING ISSUES

None.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
mbtowc(), setlocale(), strlen(), wctomb()


MKS Toolkit 9.2 Documentation Build 16.