Find the number of bytes used by a multibyte-character string
#include <photon/PhProto.h> int mbstrnlen( char const *text, int max_len, int char_width, int *num );
The mbstrnlen() function returns the number of bytes occupied by max_len characters in the string text.
The char_width parameter must be set to the maximum number of bytes used to represent a single character or 0 to accept the default value of 3.
The num parameter is set to the number of characters formed by the number of bytes returned. This will be different from max_len if there are fewer than max_len multibyte characters in text.
The number of bytes occupied by max_len characters in the string text.
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |