From a05ae051d86bad67ba03620cfb6871b29e618e85 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 5 Oct 2013 23:30:52 +0000 Subject: [PATCH] Fix capturing non-ASCII output using wxExecute(). Explicitly use wxConvLibc with wxTextInputStream to make sure we correctly decode non-ASCII data in the subprocess output. This is a hack, the real solution would be to make wxTextInputStream work properly with wxConvAuto. See #14720. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/common/utilscmn.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index c56c914977..65a709bcf4 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -598,6 +598,7 @@ wxMSW: wxOSX: - Improve handling of keyboard entry using IME (minoki). +- Fix capturing non-ASCII output using wxExecute(). - Fix column sorting UI in wxDataViewCtrl (Myrsloik). diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 6c597072a9..b70f18f5a2 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -630,7 +630,10 @@ static bool ReadAll(wxInputStream *is, wxArrayString& output) // the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state is->Reset(); - wxTextInputStream tis(*is); + // Notice that wxTextInputStream doesn't work correctly with wxConvAuto + // currently, see #14720, so use the current locale conversion explicitly + // under assumption that any external program should be using it too. + wxTextInputStream tis(*is, " \t", wxConvLibc); for ( ;; ) {