diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:36:47 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:36:47 +0000 |
commit | e3648455aa6dba0954c872389f7c7ee3a9a99676 (patch) | |
tree | 3fd72c54d3e6e586e9a74fc93aa08996e7eaba6c /src/debug.cpp | |
parent | e37968aadd8c14d15d49b90754a69126bdf674e7 (diff) | |
download | openttd-e3648455aa6dba0954c872389f7c7ee3a9a99676.tar.xz |
(svn r25674) -Fix: [Win32] The console code page for non-Unicode builds is not the normal ANSI code page and definitely not UTF-8 either.
Diffstat (limited to 'src/debug.cpp')
-rw-r--r-- | src/debug.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/debug.cpp b/src/debug.cpp index e6fb61292..d173ff14c 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -131,13 +131,14 @@ static void debug_print(const char *dbg, const char *buf) fflush(f); #endif } else { + char buffer[512]; + seprintf(buffer, lastof(buffer), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf); #if defined(WINCE) - /* We need to do OTTD2FS twice, but as it uses a static buffer, we need to store one temporary */ - TCHAR tbuf[512]; - _sntprintf(tbuf, sizeof(tbuf), _T("%s"), OTTD2FS(dbg)); - NKDbgPrintfW(_T("dbg: [%s] %s\n"), tbuf, OTTD2FS(buf)); + NKDbgPrintfW(OTTD2FS(buffer)); +#elif defined(WIN32) || defined(WIN64) + _fputts(OTTD2FS(buffer, true), stderr); #else - fprintf(stderr, "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf); + fputs(buffer, stderr); #endif #ifdef ENABLE_NETWORK NetworkAdminConsole(dbg, buf); |