ucrtbase: Support UTF8 codepage in _wctomb_s_l.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6180c2fc83
commit
69b701a4a0
|
@ -1905,7 +1905,8 @@ int CDECL MSVCRT__wctomb_s_l(int *len, char *mbchar, MSVCRT_size_t size,
|
|||
MSVCRT_wchar_t wch, MSVCRT__locale_t locale)
|
||||
{
|
||||
MSVCRT_pthreadlocinfo locinfo;
|
||||
BOOL error;
|
||||
BOOL error = FALSE;
|
||||
BOOL *perror;
|
||||
int mblen;
|
||||
|
||||
if(!mbchar && size>0) {
|
||||
|
@ -1942,7 +1943,8 @@ int CDECL MSVCRT__wctomb_s_l(int *len, char *mbchar, MSVCRT_size_t size,
|
|||
return 0;
|
||||
}
|
||||
|
||||
mblen = WideCharToMultiByte(locinfo->lc_codepage, 0, &wch, 1, mbchar, size, NULL, &error);
|
||||
perror = (locinfo->lc_codepage != CP_UTF8 ? &error : NULL);
|
||||
mblen = WideCharToMultiByte(locinfo->lc_codepage, 0, &wch, 1, mbchar, size, NULL, perror);
|
||||
if(!mblen || error) {
|
||||
if(!mblen && GetLastError()==ERROR_INSUFFICIENT_BUFFER) {
|
||||
if(mbchar && size>0)
|
||||
|
|
Loading…
Reference in New Issue