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 3df934acad)
This commit is contained in:
Fabio Alessandrelli 2017-01-16 18:43:29 +01:00 committed by Rémi Verschelde
parent 507bb0e1cb
commit b9451ce58d
1 changed files with 2 additions and 10 deletions

View File

@ -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); MultiByteToWideChar(CP_UTF8,0,buf,len,wbuf,wlen);
wbuf[wlen]=0; wbuf[wlen]=0;
// Recent MinGW and MSVC compilers seem to disagree on the case here
#ifdef __MINGW32__
if (p_stderr) if (p_stderr)
fwprintf(stderr, L"%S", wbuf); fwprintf(stderr, L"%ls", wbuf);
else else
wprintf(L"%S", wbuf); wprintf(L"%ls", wbuf);
#else // MSVC
if (p_stderr)
fwprintf(stderr, L"%s", wbuf);
else
wprintf(L"%s", wbuf);
#endif
#ifdef STDOUT_FILE #ifdef STDOUT_FILE
//vwfprintf(stdo,p_format,p_list); //vwfprintf(stdo,p_format,p_list);