_ismbslead, _ismbstrail, _ismbslead_l, _ismbstrail_l


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at _ismbslead, _ismbstrail, _ismbslead_l, _ismbstrail_l.

Performs context-sensitive tests for multibyte-character-string lead bytes and trail bytes and determines whether a given substring pointer points to a lead byte or a trail byte.

System_CAPS_ICON_important.jpg Important

This API cannot be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported with /ZW.

int _ismbslead(  
   const unsigned char *str,  
   const unsigned char *current   
int _ismbstrail(  
   const unsigned char *str,  
   const unsigned char *current   
int _ismbslead_l(  
   const unsigned char *str,  
   const unsigned char *current,  
   _locale_t locale  
int _ismbstrail_l(  
   const unsigned char *str,  
   const unsigned char *current,  
   _locale_t locale  


Pointer to the start of the string or the previous known lead byte.

Pointer to the position in the string to be tested.

The locale to use.

_ismbslead returns –1 if the character is a lead byte and _ismbstrail returns –1 if the character is a trail byte. If the input strings are valid but are not a lead byte or trail byte, these functions return zero. If either argument is NULL, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, these functions return NULL and set errno to EINVAL.

_ismbslead and _ismbstrail are slower than the _ismbblead and _ismbbtrail versions because they take the string context into account.

The versions of these functions that have the _l suffix are identical except that for their locale-dependent behavior they use the locale that's passed in instead of the current locale. For more information, see Locale.

RoutineRequired headerOptional header
_ismbslead<mbctype.h> or <mbstring.h><ctype.h>,* <limits.h>, <stdlib.h>
_ismbstrail<mbctype.h> or <mbstring.h><ctype.h>,* <limits.h>, <stdlib.h>
_ismbslead_l<mbctype.h> or <mbstring.h><ctype.h>,* <limits.h>, <stdlib.h>
_ismbstrail_l<mbctype.h> or <mbstring.h><ctype.h>,* <limits.h>, <stdlib.h>

* For manifest constants for the test conditions.

For more compatibility information, see Compatibility.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Character Classification
_ismbc Routines
is, isw Routines
_ismbb Routines