From fa8a482593938f04ea6cae1c39f8eb0faf9acb6a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 19 Feb 2016 02:34:20 +0100 Subject: [PATCH] Don't lose Unicode data in wxMessageOutputStderr Ensure that we do output the string contents even if we have to encode it in UTF-8 instead of the current locale encoding -- this is still better than not outputting anything at all. Closes #17358. --- src/common/msgout.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/common/msgout.cpp b/src/common/msgout.cpp index 48587c5624..9003413e57 100644 --- a/src/common/msgout.cpp +++ b/src/common/msgout.cpp @@ -148,13 +148,8 @@ wxString wxMessageOutputStderr::AppendLineFeedIfNeeded(const wxString& str) void wxMessageOutputStderr::Output(const wxString& str) { const wxString strWithLF = AppendLineFeedIfNeeded(str); - const wxWX2MBbuf buf = strWithLF.mb_str(); - - if ( buf ) - fprintf(m_fp, "%s", (const char*) buf); - else // print at least something - fprintf(m_fp, "%s", (const char*) strWithLF.ToAscii()); + fprintf(m_fp, "%s", (const char*) strWithLF.mb_str(wxConvWhateverWorks)); fflush(m_fp); }