From 765e7d349e1d9b20fda640672a2e6864db4d8b08 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Mon, 5 Aug 2013 20:36:55 +0000 Subject: (svn r25676) -Fix: [Win32] The ANSI code page is not UTF-8 for non-Unicode builds. --- src/os/windows/crashlog_win.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/os/windows/crashlog_win.cpp') diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp index 646b06f2b..44edd72f1 100644 --- a/src/os/windows/crashlog_win.cpp +++ b/src/os/windows/crashlog_win.cpp @@ -197,7 +197,7 @@ static char *PrintModuleInfo(char *output, const char *last, HMODULE mod) GetModuleFileName(mod, buffer, MAX_PATH); GetFileInfo(&dfi, buffer); output += seprintf(output, last, " %-20s handle: %p size: %d crc: %.8X date: %d-%.2d-%.2d %.2d:%.2d:%.2d\n", - WIDE_TO_MB(buffer), + FS2OTTD(buffer), mod, dfi.size, dfi.crc32, @@ -621,11 +621,9 @@ static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARA { switch (msg) { case WM_INITDIALOG: { -#if defined(UNICODE) /* We need to put the crash-log in a separate buffer because the default * buffer in MB_TO_WIDE is not large enough (512 chars) */ - wchar_t crash_msgW[lengthof(CrashLogWindows::current->crashlog)]; -#endif + TCHAR crash_msgW[lengthof(CrashLogWindows::current->crashlog)]; /* Convert unix -> dos newlines because the edit box only supports that properly :( */ const char *unix_nl = CrashLogWindows::current->crashlog; char dos_nl[lengthof(CrashLogWindows::current->crashlog)]; @@ -655,7 +653,7 @@ static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARA } SetDlgItemText(wnd, 10, text); - SetDlgItemText(wnd, 11, MB_TO_WIDE_BUFFER(dos_nl, crash_msgW, lengthof(crash_msgW))); + SetDlgItemText(wnd, 11, convert_to_fs(dos_nl, crash_msgW, lengthof(crash_msgW))); SendDlgItemMessage(wnd, 11, WM_SETFONT, (WPARAM)GetStockObject(ANSI_FIXED_FONT), FALSE); SetWndSize(wnd, -1); } return TRUE; -- cgit v1.2.3-70-g09d2