1 /* From: Miloslav Trmac <mitr@volny.cz> */
12 char back
[MB_LEN_MAX
];
16 setlocale(LC_ALL
, "");
17 printf("Charset: %s\n", nl_langinfo(CODESET
));
18 ret
= mbtowc(&wc
, "\xe4", 1);
19 printf("mbtowc(): %d\n", ret
);
21 printf("Result: 0x%08lX\n",(unsigned long)wc
);
22 ret
= wctomb(back
, wc
);
23 printf("wctomb(): %d\n", ret
);
24 for(i
= 0; ret
> 0 && i
<(size_t)ret
; i
++)
25 printf("%02X ",(unsigned char)back
[i
]);