/* Convertors for UTF-7 Name: UNICODE-1-1-UTF-7 [RFC1642] MIBenum: 103 Source: RFC 1642 Alias: csUnicode11UTF7 */ #include #include #include #include #include "xlocale.h" #include "xwchar.h" int _UTF7_init __P((_LocaleInfo *loc, const char *encoding)); static void _UTF7_stateinit __P((mbstate_t *)); static int _UTF7_mbsinit __P((const mbstate_t *)); static size_t _UTF7_mbrtowc __P((wchar_t*, const char*, size_t, mbstate_t *)); static size_t _UTF7_wcrtomb __P((char *, wchar_t, mbstate_t *)); int _UTF7_init(loc, encoding) _LocaleInfo *loc; const char *encoding; { if (!strcasecmp(encoding, "UNICODE-1-1-UTF-7")) { loc->mbcurmax = ; loc->stateinit = _UTF7_stateinit; loc->mbsinit = _UTF7_mbsinit; loc->mbrtowc = _UTF7_mbrtowc; loc->wcrtomb = _UTF7_wcrtomb; return 0; } else return -1; } static size_t _UTF7_mbrtowc(pwc, s, len, mbs) wchar_t *pwc; const char *s; size_t len; mbstate_t *mbs; { u_char *in = (u_char *)s; int c, c2, c3, c4, c5, c6; wchar_t wc; if (s == NULL) { /* initial state */ /* _UTF7_stateinit(mbs); */ return 0; /* Shift_Jis has no states */ } } static size_t _UTF7_wcrtomb(s, wc, wcs) char *s; wchar_t wc; mbstate_t *wcs; { return 1; }