mblen()

Computes the length of an encoded multibyte character string, encoded as defined by the LC_CTYPE category of the current locale.

  #include <stdlib.h>
  
  int mblen(const char *s, size_t n);    
Parameter

s

A pointer to the multibyte character string to measure.

n

The maximum size of the multibyte character string.

Remarks

The mblen() function returns the length of the multibyte character pointed to by s. It examines a maximum of n characters.

If s is a null pointer, the mblen() function returns a nonzero or zero value signifying whether multibyte encoding does or does not have state-dependent encoding. If s is not a null pointer, the mblen() function either returns 0 (if s points to the null character), or returns the number of bytes that are contained in the multibyte.