Mercurial > hg > openttd
comparison src/debug.cpp @ 20699:d198fbc52efc draft
-Fix: [Win32] The console code page for non-Unicode builds is not the normal ANSI code page and definitely not UTF-8 either.
author | Michael Lutz <michi@icosahedron.de> |
---|---|
date | Thu, 28 Mar 2013 02:41:43 +0100 (2013-03-28) |
parents | 9bb2cce59004 |
children |
comparison
equal
deleted
inserted
replaced
20698:cbef5ef83eb0 | 20699:d198fbc52efc |
---|---|
129 | 129 |
130 fprintf(f, "%s\n", buf); | 130 fprintf(f, "%s\n", buf); |
131 fflush(f); | 131 fflush(f); |
132 #endif | 132 #endif |
133 } else { | 133 } else { |
134 char buffer[512]; | |
135 seprintf(buffer, lastof(buffer), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf); | |
134 #if defined(WINCE) | 136 #if defined(WINCE) |
135 /* We need to do OTTD2FS twice, but as it uses a static buffer, we need to store one temporary */ | 137 NKDbgPrintfW(OTTD2FS(buffer)); |
136 TCHAR tbuf[512]; | 138 #elif defined(WIN32) || defined(WIN64) |
137 _sntprintf(tbuf, sizeof(tbuf), _T("%s"), OTTD2FS(dbg)); | 139 _fputts(OTTD2FS(buffer, true), stderr); |
138 NKDbgPrintfW(_T("dbg: [%s] %s\n"), tbuf, OTTD2FS(buf)); | |
139 #else | 140 #else |
140 fprintf(stderr, "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf); | 141 fputs(buffer, stderr); |
141 #endif | 142 #endif |
142 #ifdef ENABLE_NETWORK | 143 #ifdef ENABLE_NETWORK |
143 NetworkAdminConsole(dbg, buf); | 144 NetworkAdminConsole(dbg, buf); |
144 #endif /* ENABLE_NETWORK */ | 145 #endif /* ENABLE_NETWORK */ |
145 IConsoleDebug(dbg, buf); | 146 IConsoleDebug(dbg, buf); |