Restore wxConvAuto in wxTextInputStream used by wxExecute()
This reverts commit a05ae051d8
and allows
to correctly decode UTF-8 output of child processes again.
Also add a (disabled by default) test allowing to verify that this does
work now.
Closes #14720, #18382.
This commit is contained in:
@@ -516,3 +516,28 @@ void ExecTestCase::TestOverlappedSyncExecute()
|
||||
CPPUNIT_ASSERT_EQUAL( SLEEP_END_STRING, longSleepOutput.Last() );
|
||||
#endif // !__WINDOWS__
|
||||
}
|
||||
|
||||
#ifdef __UNIX__
|
||||
|
||||
// This test is disabled by default because it must be run in French locale,
|
||||
// i.e. with explicit LC_ALL=fr_FR.UTF-8 and only works with GNU ls, which
|
||||
// produces the expected output.
|
||||
TEST_CASE("wxExecute::RedirectUTF8", "[exec][unicode][.]")
|
||||
{
|
||||
wxArrayString output;
|
||||
REQUIRE( wxExecute("/bin/ls --version", output) == 0 );
|
||||
|
||||
for ( size_t n = 0; n < output.size(); ++n )
|
||||
{
|
||||
// It seems unlikely that this part of the output will change for GNU
|
||||
// ls, so check for its presence as a sign that the program output was
|
||||
// decoded correctly.
|
||||
if ( output[n].find(wxString::FromUTF8("vous \xc3\xaates libre")) != wxString::npos )
|
||||
return;
|
||||
}
|
||||
|
||||
INFO("output was:\n" << wxJoin(output, '\n'));
|
||||
FAIL("Expected output fragment not found.");
|
||||
}
|
||||
|
||||
#endif // __UNIX__
|
||||
|
Reference in New Issue
Block a user