Commit 769a4bb5 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed ntdll_wcstoumbs and WideCharToMultiByte to set the 'used' flag

for UTF-8 codepage too. This was causing DIR_nt_to_unix to fail in some cases (tracked down with help from Alex Pasadyn).
parent 0a5e2c5c
...@@ -1535,6 +1535,7 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen, ...@@ -1535,6 +1535,7 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
} }
/* fall through */ /* fall through */
case CP_UTF8: case CP_UTF8:
if (used) *used = FALSE; /* all chars are valid for UTF-8 */
ret = wine_utf8_wcstombs( src, srclen, dst, dstlen ); ret = wine_utf8_wcstombs( src, srclen, dst, dstlen );
break; break;
default: default:
......
...@@ -71,10 +71,11 @@ int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int ds ...@@ -71,10 +71,11 @@ int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int ds
int ntdll_wcstoumbs(DWORD flags, const WCHAR* src, int srclen, char* dst, int dstlen, int ntdll_wcstoumbs(DWORD flags, const WCHAR* src, int srclen, char* dst, int dstlen,
const char* defchar, int *used ) const char* defchar, int *used )
{ {
return (unix_table) ? if (unix_table)
wine_cp_wcstombs( unix_table, flags, src, srclen, dst, dstlen, defchar, used ) : return wine_cp_wcstombs( unix_table, flags, src, srclen, dst, dstlen, defchar, used );
wine_utf8_wcstombs( src, srclen, dst, dstlen ); if (used) *used = 0; /* all chars are valid for UTF-8 */
return wine_utf8_wcstombs( src, srclen, dst, dstlen );
} }
/************************************************************************** /**************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment