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

25 lines
501 B
C
Raw Permalink Normal View History

#include <stdio.h>
#include <mbctype.h>
#include <mbstring.h>
void main()
{
unsigned int c;
unsigned char *str1;
unsigned char *str2;
unsigned char buf[30];
_setmbcp( 932 );
str1 = "ab\x82\x62\x82\x63\ef\x81\x66";
str2 = buf;
for( ; *str1 != '\0'; ) {
str1 = _mbgetcode( str1, &c );
str2 = _mbputchar( str2, '<' );
str2 = _mbputchar( str2, c );
str2 = _mbputchar( str2, '>' );
}
*str2 = '\0';
printf( "%s\n", buf );
}