2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
8 * 25/11/05: Added license header
13 /*********************************************************************
16 int CDECL
_mbtowc_l(wchar_t *dst
, const char* str
, size_t n
, _locale_t locale
)
18 MSVCRT_pthreadlocinfo locinfo
;
19 wchar_t tmpdst
= '\0';
22 locinfo
= get_locinfo();
24 locinfo
= (MSVCRT_pthreadlocinfo
)(locale
->locinfo
);
28 if(!locinfo
->lc_codepage
)
29 tmpdst
= (unsigned char)*str
;
30 else if(!MultiByteToWideChar(locinfo
->lc_codepage
, 0, str
, n
, &tmpdst
, 1))
34 /* return the number of bytes from src that have been used */
37 if(n
>= 2 && _isleadbyte_l((unsigned char)*str
, locale
) && str
[1])
42 /*********************************************************************
45 int CDECL
mbtowc(wchar_t *dst
, const char* str
, size_t n
)
47 return _mbtowc_l(dst
, str
, n
, NULL
);