mirror of
https://github.com/itsmattkc/dotnet9x.git
synced 2025-01-22 09:11:55 -05:00
patch unsupported modes of WideCharToMultiByte
This commit is contained in:
parent
ef1d8819d1
commit
d9d866e5c5
1 changed files with 12 additions and 1 deletions
|
@ -351,7 +351,18 @@ BOOL WINAPI CORKEL32_FreeEnvironmentStringsW(LPWSTR param_0)
|
|||
INT WINAPI CORKEL32_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, INT cchWideChar, LPSTR lpMultiByteStr, INT cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar)
|
||||
{
|
||||
INT r;
|
||||
dwFlags = 0;
|
||||
|
||||
// Windows 95 doesn't support these flags and will throw an error if they're specified
|
||||
const unsigned short WC_ERR_INVALID_CHARS = 0x80;
|
||||
const unsigned short WC_NO_BEST_FIT_CHARS = 0x400;
|
||||
dwFlags &= ~WC_NO_BEST_FIT_CHARS;
|
||||
dwFlags &= ~WC_ERR_INVALID_CHARS;
|
||||
|
||||
// Windows 95 doesn't appear to support UTF-8 conversion, so we fallback to the default multibyte codepage
|
||||
if (CodePage == CP_UTF8) {
|
||||
CodePage = CP_ACP;
|
||||
}
|
||||
|
||||
r = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar);
|
||||
Trace(TRACE_PASSTHROUGH, "WideCharToMultiByte, r = %i, CodePage = %u, dwFlags = %u", r, CodePage, dwFlags);
|
||||
return r;
|
||||
|
|
Loading…
Reference in a new issue