diff options
| author | Fabio Alessandrelli | 2017-01-16 18:43:29 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-18 19:42:21 +0100 |
| commit | b9451ce58d6f92ef1e838d01c203cdd99e87607e (patch) | |
| tree | 4c4891d74e14376fed4b94876d11cd9225d2adb8 /platform/windows | |
| parent | 507bb0e1cb34e875d52685fd2100c448579f6bac (diff) | |
| download | godot-b9451ce58d6f92ef1e838d01c203cdd99e87607e.tar.gz godot-b9451ce58d6f92ef1e838d01c203cdd99e87607e.tar.zst godot-b9451ce58d6f92ef1e838d01c203cdd99e87607e.zip | |
Fix gibberish output for windows/mingw.
%ls should be used instead of %s or %S to speficy narrow/wide charstring
in wprintf fwprintf
Fixes #6252
(cherry picked from commit 3df934acadeadaf7b2f2920411016dcb3bde7d99)
Diffstat (limited to 'platform/windows')
| -rw-r--r-- | platform/windows/os_windows.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index fac067fcd..b56469755 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1329,18 +1329,10 @@ void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) { MultiByteToWideChar(CP_UTF8,0,buf,len,wbuf,wlen); wbuf[wlen]=0; -// Recent MinGW and MSVC compilers seem to disagree on the case here -#ifdef __MINGW32__ if (p_stderr) - fwprintf(stderr, L"%S", wbuf); + fwprintf(stderr, L"%ls", wbuf); else - wprintf(L"%S", wbuf); -#else // MSVC - if (p_stderr) - fwprintf(stderr, L"%s", wbuf); - else - wprintf(L"%s", wbuf); -#endif + wprintf(L"%ls", wbuf); #ifdef STDOUT_FILE //vwfprintf(stdo,p_format,p_list); |
