24{
26 if (!
string || *
string ==
'\0' ||
max_count == 0)
27 {
29 return 0;
30 }
31
33
35 {
38 {
40 }
42 }
43
45 locale->locinfo->_public._locale_mb_cur_max == 1 ||
46 locale->locinfo->_public._locale_mb_cur_max == 2);
47
49 {
50 _ASSERTE(
locale->locinfo->_public._locale_lc_codepage !=
CP_UTF8 &&
L"UTF-8 isn't supported in this _mblen_l function yet!!!");
51
52
54
55
56 if (
locale->locinfo->_public._locale_mb_cur_max <= 1)
57 {
58 return -1;
59 }
60
62 {
63 return -1;
64 }
65
66 int const status = __acrt_MultiByteToWideChar(
67 locale->locinfo->_public._locale_lc_codepage,
69 string,
70 locale->locinfo->_public._locale_mb_cur_max,
71 nullptr,
72 0);
73
75 {
76 return -1;
77 }
78
79 return locale->locinfo->_public._locale_mb_cur_max;
80 }
81 else
82 {
83
84
85 if (
locale->locinfo->_public._locale_lc_codepage !=
CP_ACP)
86 {
87 int const status = __acrt_MultiByteToWideChar(
88 locale->locinfo->_public._locale_lc_codepage,
90 string,
91 1,
92 nullptr,
93 0);
94
96 {
97 return -1;
98 }
99 }
100
102 }
103}
_Check_return_ __forceinline unsigned short __cdecl _isleadbyte_fast_internal(_In_ unsigned char const c, _In_ _locale_t const locale)
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Character const *const size_t const max_count
#define MB_ERR_INVALID_CHARS
size_t __cdecl __mbrtowc_utf8(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps, __crt_cached_ptd_host &ptd)