size_t mbrlen(const char *s, size_t n, mbstate_t *ps);
size_t mbrlen_l(const char *s, size_t n, mbstate_t *ps, locale_t locale);
If s is not null, the
mbstate_t internal; mbrtowc(NULL, s, n, ps != NULL ? ps : &internal);
If the specified state pointer is null, the
The behavior of this function is affected by the LC_CTYPE category of the current locale.
Points to the string whose bytes are to be counted.
Specifies the maximum number of bytes to examine.
Is the conversion state. If this is null, an internal mbstate_t object is used.
If the next n or fewer bytes complete the character that corresponds to the null wide character.
- positive number
If the next n or fewer bytes complete a valid character; the value returned is the number of bytes that complete the character.
If the next n bytes contribute to an incomplete by potentially valid character, and all n bytes have been processed. When n has at least the value of MB_CUR_MAX (or MB_CUR_MAX_L), this case can only occur if s points at a sequence of redundant shift sequences (for locales with state-dependent encodings).
If an encoding error occurs, in which case the next n or fewer bytes do not contribute to a complete and valid character. In this case, errno is set to EILSEQ, and the conversion state is undefined.
MT-Safe, with exceptions.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
mbrtowc(), mbrtowc_l(), mbsinit(), mbsinit_l(), mbsnrtowcs(), mbsnrtowcs_l(), mbsrtowcs(), mbsrtowcs_l(), newlocale(), setlocale(), wcrtomb(), wcrtomb_l(), wcsrtombs(), wcsrtombs_l()
PTC MKS Toolkit 10.3 Documentation Build 39.