Re: msvcrt: implement _mbbtype according to MSDN
"Juan Lang" <juan_lang(a)yahoo.com> wrote:
/********************************************************************* + * _mbbtype(MSVCRT.@) + */ +int CDECL _mbbtype(unsigned char c, int type) +{ + if (type == 1) + { + if ((c >= 0x20 && c <= 0x7e) || (c >= 0xa1 && c <= 0xdf)) + return _MBC_SINGLE; + else if ((c >= 0x40 && c <= 0x7e) || (c >= 0x80 && c <= 0xfc)) + return _MBC_TRAIL; + else + return _MBC_ILLEGAL; + } + else + { + if ((c >= 0x20 && c <= 0x7e) || (c >= 0xa1 && c <= 0xdf)) + return _MBC_SINGLE; + else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) + return _MBC_LEAD; + else + return _MBC_ILLEGAL; + }
Since MSVCRT_mbctype array is not currently being initialized, probably using MSVCRT_current_ctype would be good enough for now. -- Dmitry.
participants (1)
-
Dmitry Timoshkov