Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

_mbsbtype

Returns the type of byte within a string.

int _mbsbtype(
   const unsigned char *mbstr,
   size_t count 
);

Parameters

mbstr
Address of a sequence of multibyte characters.
count
Byte offset from head of string.

Return Value

_mbsbtype returns an integer value indicating the result of the test on the specified byte. The manifest constants in the following table are defined in MBCTYPE.H.

Return value Byte type
_MBC_SINGLE (0) Single-byte character. For example, in code page 932, _mbsbtype returns 0 if the specified byte is within the range 0x20 – 0x7E or 0xA1 – 0xDF.
_MBC_LEAD (1) Lead byte of multibyte character. For example, in code page 932, _mbsbtype returns 1 if the specified byte is within the range 0x81 – 0x9F or 0xE0 – 0xFC.
_MBC_TRAIL (2) Trailing byte of multibyte character. For example, in code page 932, _mbsbtype returns 2 if the specified byte is within the range 0x40 – 0x7E or 0x80 – 0xFC.
_MBC_ILLEGAL (–1) Invalid character, or NULL byte found before the byte at offset count in mbstr.

Remarks

The _mbsbtype function determines the type of a byte in a multibyte character string. The function examines only the byte at offset count in mbstr, ignoring invalid characters before the specified byte.

Requirements

Routine Required header Optional headers Compatibility
_mbsbtype <mbstring.h> <mbctype.h>* Win 98, Win Me, Win NT, Win 2000, Win XP

* For manifest constants used as return values.

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

See Also

Byte Classification | Run-Time Routines and .NET Framework Equivalents

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.