_mbbtype
Returns the byte type based on the previous byte.
int _mbbtype( unsigned char c, int type );
Parameters
- c
- Character to test.
- type
- Type of byte to test for.
Return Value
_mbbtype returns the type of byte within a string. This decision is context-sensitive as specified by the value of type, which provides the control test condition. type is the type of the previous byte in the string. The manifest constants in the following table are defined in MBCTYPE.H.
Value of type | _mbbtype tests for | Return value | c |
|---|---|---|---|
| Any value except 1 | Valid single byte or lead byte | _MBC_SINGLE (0) | Single byte (0x20 – 0x7E, 0xA1 – 0xDF) |
| Any value except 1 | Valid single byte or lead byte | _MBC_LEAD (1) | Lead byte of multibyte character (0x81 – 0x9F, 0xE0 – 0xFC) |
| Any value except 1 | Valid single-byte or lead byte | _MBC_ILLEGAL ( –1) | Invalid character (any value except 0x20 – 0x7E, 0xA1 – 0xDF, 0x81 – 0x9F, 0xE0 – 0xFC |
| 1 | Valid trail byte | _MBC_TRAIL (2) | Trailing byte of multibyte character (0x40 – 0x7E, 0x80 – 0xFC) |
| 1 | Valid trail byte | _MBC_ILLEGAL ( –1) | Invalid character (any value except 0x20 – 0x7E, 0xA1 – 0xDF, 0x81 – 0x9F, 0xE0 – 0xFC |
Remarks
The _mbbtype function determines the type of a byte in a multibyte character. If the value of type is any value except 1, _mbbtype tests for a valid single-byte or lead byte of a multibyte character. If the value of type is 1, _mbbtype tests for a valid trail byte of a multibyte character.
In earlier versions, _mbbtype was called chkctype. For new code, use _mbbtype instead.
Requirements
| Routine | Required header | Optional headers | Compatibility |
|---|---|---|---|
| _mbbtype | <mbstring.h> | <mbctype.h>* | Win 98, Win Me, Win NT, Win 2000, Win XP |
* For definitions of 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