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

35 lines
773 B
C
Raw Normal View History

#include <stdio.h>
#include <mbctype.h>
#include <mbstring.h>
unsigned int chars[] = {
'A', /* single-byte A */
'B', /* single-byte B */
'C', /* single-byte C */
'D', /* single-byte D */
'E', /* single-byte E */
0x8260, /* double-byte A */
0x8261, /* double-byte B */
0x8262, /* double-byte C */
0x8263, /* double-byte D */
0x8264 /* double-byte E */
};
#define SIZE sizeof( chars ) / sizeof( unsigned int )
void main()
{
int i;
unsigned int c;
_setmbcp( 932 );
for( i = 0; i < SIZE; i++ ) {
c = _mbctolower( chars[ i ] );
if( c > 0xff )
printf( "%c%c", c>>8, c );
else
printf( "%c", c );
}
printf( "\n" );
}