This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/ismbblea.c

32 lines
727 B
C

#include <stdio.h>
#include <mbctype.h>
unsigned int chars[] = {
' ',
'.',
'1',
'A',
0x8140, /* double-byte space */
0x8260, /* double-byte A */
0x82A6, /* double-byte Hiragana */
0x8342, /* double-byte Katakana */
0xA1, /* single-byte Katakana punctuation */
0xA6, /* single-byte Katakana alphabetic */
0xDF, /* single-byte Katakana alphabetic */
0xE0A1 /* double-byte Kanji */
};
#define SIZE sizeof( chars ) / sizeof( unsigned int )
void main()
{
int i;
_setmbcp( 932 );
for( i = 0; i < SIZE; i++ ) {
printf( "%#6.4x does %shave a valid first byte\n",
chars[i],
( _ismbblead( chars[i]>>8 ) ) ? "" : "not " );
}
}