#include #include mbstate_t _mblen_state; mbstate_t _mbtowc_state; mbstate_t _wctomb_state; int mblen(s,n) const char *s; size_t n; { return _mbrtowc_(NULL, s, n, &_mblen_state); } int mbtowc(pwc, s, n) wchar_t *pwc; const char *s; size_t n; { return _mbrtowc_(pwc, s, n, &_mbtowc_state); } int wctomb(s, wchar) char *s; wchar_t wchar; { return _wcrtomb_(s, wchar, &_wctomb_state); } size_t mbstowcs(pwcs, s, n) wchar_t *pwcs; const char *s; size_t n; { mbstate_t state; _mbrtowc_(NULL,NULL,0,&state); return mbsrtowcs(pwcs, s, n, &state); } size_t wcstombs(s, pwcs, n) char *s; const wchar_t *pwcs; size_t n; { mbstate_t state; _wcrtomb_(NULL,NULL,&state); return wcsrtombs(s, pwcs, n, &state); }