mirror of https://github.com/OpenTTD/OpenTTD
Change: [Win32] Set the console codepage to UTF-8
parent
afea5e85ae
commit
16abdd5254
|
@ -128,13 +128,7 @@ void DebugPrint(const char *level, const std::string &message)
|
|||
#endif
|
||||
} else {
|
||||
std::string msg = fmt::format("{}dbg: [{}] {}\n", GetLogPrefix(), level, message);
|
||||
#if defined(_WIN32)
|
||||
wchar_t system_buf[512];
|
||||
convert_to_fs(msg.c_str(), system_buf, lengthof(system_buf));
|
||||
fputws(system_buf, stderr);
|
||||
#else
|
||||
fputs(msg.c_str(), stderr);
|
||||
#endif
|
||||
|
||||
NetworkAdminConsole(level, message);
|
||||
if (_settings_client.gui.developer >= 2) IConsolePrint(CC_DEBUG, "dbg: [{}] {}", level, message);
|
||||
|
|
|
@ -393,6 +393,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
|||
* be available between subsequent calls to FS2OTTD(). */
|
||||
char *cmdline = stredup(FS2OTTD(GetCommandLine()).c_str());
|
||||
|
||||
/* Set the console codepage to UTF-8. */
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
|
||||
#if defined(_DEBUG)
|
||||
CreateConsole();
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue