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/mbterm.c

26 lines
446 B
C

#include <stdio.h>
#include <mbctype.h>
#include <mbstring.h>
const unsigned char chars[] = {
' ',
'.',
'1',
'A',
0x81,0x40, /* double-byte space */
0x82,0x00 /* invalid double-byte */
};
#define SIZE sizeof( chars ) / sizeof( unsigned char )
void main()
{
int i;
_setmbcp( 932 );
for( i = 0; i < SIZE; i++ ) {
printf( "0x%2.2x %d\n", chars[i],
_mbterm( &chars[i] ) );
}
}