53 char *_Pstate = (
char *)&
_State;
57 for (; _Mid1 != _Last1 && _Mid2 != _Last2; )
59 unsigned char _By = (
unsigned char)*_Mid1;
64 _Ch = _By, _Nextra = 0;
68 return (_Mybase::error);
71 _Ch = _By & 0x1f, _Nextra = 1;
73 _Ch = _By & 0x0f, _Nextra = 2;
75 _Ch = _By & 0x07, _Nextra = 3;
77 _Ch = _By & 0x03, _Nextra = _By < 0xfc ? 4 : 5;
81 else if (_Last1 - _Mid1 < _Nextra + 1)
84 for (++_Mid1; 0 < _Nextra; --_Nextra, ++_Mid1)
85 if ((_By = (
unsigned char)*_Mid1) < 0x80 || 0xc0 <= _By)
86 return (_Mybase::error);
88 _Ch = _Ch << 6 | (_By & 0x3f);
97 _First2, _Last2, _Mid2);
99 if (_Ans == _Mybase::partial)
109 return (_Mybase::error);
110 *_Mid2++ = (_Elem)_Ch;
113 return (_First1 == _Mid1 ? _Mybase::partial : _Mybase::ok);
_Mybase::result result
Definition: utf8:33
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Check_return_ _In_z_ wchar_t const * _Mode
Definition: corecrt_wstdio.h:133
unsigned char
Definition: mbstring.h:107
virtual result do_in(_Statype &_State, const _Byte *_First1, const _Byte *_Last1, const _Byte *&_Mid1, _Elem *_First2, _Elem *_Last2, _Elem *&_Mid2) const
Definition: utf8:49